开发者

How to use Ant to download/unpack jars from a single list of jars?

开发者 https://www.devze.com 2023-03-04 23:18 出处:网络
How can I use Ant to download and unpack java jars while only specifying the lis开发者_JAVA百科t of jars once? The key here is having one list of jars and generating:

How can I use Ant to download and unpack java jars while only specifying the lis开发者_JAVA百科t of jars once? The key here is having one list of jars and generating:

  1. a list of URLs to download with a get task
  2. a classpath/fileset of the same jars locally

I'd really only like to specify the list of jars once.


<property name="dependency.lib.dir" location="dependencies" />

<mkdir dir="${dependency.lib.dir}" />

<get dest="${dependency.lib.dir}">
    <url url="http://server1/lib1.jar"/> 
    <url url="http://server2/lib2.jar"/>
</get>

<fileset id="dependency.libs" dir="${dependency.lib.dir}">
    <include name="*.jar" />
</fileset>

<path id="project.debug.classpath">
    <fileset refid="dependency.libs" />
</path>

You can add additional sub-elements to the <path> if you have a local lib directory.


As far as I can tell, this is not possible with ant.

0

精彩评论

暂无评论...
验证码 换一张
取 消