ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: How to get the jar file of a resource ?
Date Fri, 17 Dec 2004 16:02:51 GMT
On Fri, 17 Dec 2004, Yves Martin <yves.martin@elca.ch> wrote:

>  My idea is too limit the ClassPath to the strict needed jars - so I
>  do not want to use ${java.class.path} in the forked JVM ClassPath.

<junit> has an includenantruntime that you could set to false.

>  Of course it does not work because 
>   ant-junit.url ==
>   /my/path/to/apache-ant-1.6.2/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.class
> 
>  How can I get only the resource file
>  /my/path/to/apache-ant-1.6.2/lib/ant-junit.jar to use it in
>  ClassPath ?

The usually recommended string manipulating task is pathconvert,
something like

<pathconvert property="jarfile" ...>
  <path location="${ant-junit.url}"/>
  <mapper type="glob"
          from="*!/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.class"
          to="*"/>
</pathconvert>

would probably work.

Stefan

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


Mime
View raw message