I have a project that contains a number of subprojects.

To prevent duplication and potential skew, common properties and
declarations are placed into a separate XML file (common.xml) that is
re-used by the subprojects when they are build.

common.xml looks like:

<?xml version="1.0" encoding="iso-8859-1"?>

    <!-- Cross BUILD file constant properties -->
    <property environment="env" />
    <property name="emll.base"               value="${env.VIEWROOT}/emll"/>

    <!-- Define the macro's required for all -->
    <import file="${emll.base}/ant-imports/ccr_macros.xml"/>

    <!-- Property used to determine inclusion - and prevent inclusion more
than once. -->
    <if>
        <not><isset property="_include.emll.common"/></not>
        <then>
            <property name="_include.emll.common" value="included"/>

            <path id="ocm.jsse.classpath">
                <fileset dir="${ocm.dependencies.root}/ocm_common">
                    <include name="jsse.jar"/>
                </fileset>
           </path>
        </then>
    </if>

This file (common.xml) is then included using the following constructs in
the subprojects

    <!DOCTYPE project [
        <!ENTITY common SYSTEM "file:./common.xml">
    ] >

    &common;

Our main build (that compiles all subprojects) is used to drive the overall
product build. I find that we see msgs of the form:
Overriding previous definition of reference to ocm.jsse.classpath when a
target nests (antcalls') out to another subtarget and the subtarget is in
one of these subprojects.

I understand that <path id=...> structures are not interpretted at runtime
but are parsed and this is where the message is coming from. Is there a way
to prevent this from occurring and yet retain the centralized definition of
constants such that they can be used from within subprojects when they are
built or the overall project build is invoked?

I should mention that I am using Ant 1.6.2 and have to for a number of
reasons.

Thanks
Nestor

Reply via email to