Hi Leo,
I personally prefer the first form for 2 reasons:
- you better control your dependencies (and there's always a limited
number of them)
- you don't have to know the repository structure and you don't care
when it changes. By writing
${dep.artifactDirectory}/jars/${dep.artifact} you are linking the plugin
to the repository structure.
I do agree that the second form is shorter though :-)
-Vincent
> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Leo Simons
> Sent: 05 June 2003 15:06
> To: [EMAIL PROTECTED]
> Subject: tip: getting at the classpath for a plugin
>
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]