maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Simons <leosim...@apache.org>
Subject tip: getting at the classpath for a plugin
Date Thu, 05 Jun 2003 13:05:34 GMT
Hi all,

I'm currently writing a forrest plugin. I needed a way to get at all the 
dependencies of forrest to build a classpath. Most plugins I found do 
something like:

     <!-- Setup the classpath for this plugin -->
     <path id="some-classpath">
       <pathelement path="${plugin.getDependencyPath('commons-lang')}"/>
       <pathelement path="${plugin.getDependencyPath('log4j')}"/>
       <pathelement path="${plugin.getDependencyPath('velocity')}"/>
       <pathelement path="${plugin.getDependencyPath('village')}"/>
       <!-- etc etc -->
     </path>

after a lot of twiddling, I figured out that

<ant:fileset dir="${mavenRepoLocal}">
   <j:forEach var="dep" items="${plugin.dependencies}">
     <ant:include name="${dep.artifactDirectory}/jars/${dep.artifact}"/>
   </j:forEach>
</ant:fileset>

is a way to autobuild such a classpath from the plugin POM.

grz,

- LSD



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message