ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jennifer Yang" <jyoony...@gmail.com>
Subject pathtofileset or fileset referencing path
Date Wed, 15 Nov 2006 19:21:59 GMT
Hi,

I would like to define set of dependent libraries for compile and
reuse the list for creating a war.  I have seen posts recommending the
use of pathtofileset.  It looked good except that the resulting war
contained the relative paths to the dependent libs.

We have a repository of all the thirdparty libs: e.g.
<THIRD_PARTY>/lib/oracle/*.jar
<THIRD_PARTY>/lib/mysql/*.jar
<THIRD_PARTY>/lib/apache.commons/*.jar

For compile, I have set up a path: e.g.
    <path id="pathid.build.classpath">
        <fileset dir="<THIRD_PARTY>/lib/oracle">
            <include name="*.jar" />
        </fileset>
        <fileset dir="<THIRD_PARTY>/lib/apache.commons">
            <include name="*.jar" />
        </fileset>
        ...
    </path>

Then for the war target, I have:
   <pathtofileset name="war.lib.thirdparty"
                               pathrefid="pathid.build.classpath"
                               dir="${THIRDPARTY_HOME}/lib"/>
    <war warfile="mywarfile.war" webxml="${war.webxml}">
        <zipfileset refid="war.lib.thirdparty" prefix="WEB-INF/lib">
        ...
    </war>

This produces war contents as:
    WEB-INF/lib/apache.commons/commons-dbcp-1.2.1.jar
    WEB-INF/lib/apache.commons/commons-pool-1.2.jar
    WEB-INF/lib/apache.commons/commons-validator-1.3.0.jar
    WEB-INF/lib/oracle/classes12.jar

How can I get rid of the "apache.commons" and "oracle" prefixes above?

What is a good way to define dependencies in one place and reuse?

Thanks,
Jennifer

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message