开发者

how to include directories inside JAR into the classpath at buildtime using ANT?

I have a JAR in my lib folder of the 开发者_Go百科project and trying to get the directory structure that contains property files on the classpath when building using ANT. Any ideas how best to the get that structure on the classpath?

Thanks!


I'm assuming you want to load a properties file into your build using the property task.

If this is the case, there are a couple of options.

First you could use the url form of the task, using a jar url:

<property url="jar:file:lib/my_jar.jar!/path/to/myfile.properties" />

Alternatively you could use the resource form, and specify the jar as the classpath:

<property resource="/path/to/myfile.properties" classpath="lib/my_jar.jar"/>

If it's something else you want to do rather than load the properties, look into javaresource - many tasks are able to take a resource as input so you should be able to find a way to do what you want.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜