ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <>
Subject Re: AW: AW: project dependency
Date Tue, 07 Oct 2003 15:05:51 GMT
At 04:05 PM 10/7/2003 +0200, you wrote:
>I have tried using maven at home (where I don`t have internet) and it`s 
>very difficult te set up because the package you download doesn`t contain 
>everything. And I would like to continue to use ANT because I know it, and 
>apart from the dependencies, it has everything I need.

I solve the dependency issue in Ant using some hints from Tomcat's 
build.  For an example, see the build I wrote for the Prevayler project 
(for now it is at SourceForge, but it will be moving to Codehaus later this 

Here is how it basically works....

1.  Define a dependency in

# ----- Skaringa -----

2.  Add any jar file dependencies to a path to be used as a classpath ref 
throughout the build:

<path id="build.classpath" >
         <pathelement location="${skaringa.jar}"/>

3.  Add an entity include in your build.xml pointing to 
utility-targets.incl.  This contains the reusable targets that you can take 
advantage of in your build.xml.  Then add a download target for grabbing 
your dependency:

<target name="download.dependencies.core"
             description="Download binary packages needed by the core 
packages" >
         <!-- Download any sub package or tools needed. -->
         <antcall target="-downloadgz">
             <param name="sourcefile" value="${skaringa.loc}"/>
             <param name="destfile"   value="${skaringa.jar}"/>

Available reusable download targets are "-downloadgz", "-downloadzip", and 

4.  Add the target "download.dependencies.core" (or whatever you name it) 
as a dependency for a compile (or other) target that requires the library 
you have specified.

Jar files will be checked for existence before attempting a download which 
keeps jar from being downloaded every time.  Note that the path to the jar 
file for any particular library will depend on the internal directory 
organization of the archive containing the jar.  Make sure to pay attention 
to this when you define your dependencies in  Also note 
that the utility-targets.incl assumes that you have defined a dependency in 
your for ant-contrib.  Again, see the Prevayler, utility-targets.incl, and build.xml for a working 
example of all this.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message