From: "Nathan Coast" <[EMAIL PROTECTED]>
> Is it possible to invoke goals multiple times with different sets of
properties?
> Specifically, I'd like to be able to compile sub-sets of my source at
> different times during a build and to jar them into different jars. I'd
like to
> do this by changing the values of properties used by the appropriate goals
> (java:compile and java:jar). If Jelly supports this, how do I do it?
Right now I think the <attainGoal> is a bit too clever in that it will know
when its been attained, so won't be invokable twice.
So maybe we need some call mechanism so that you could do something like
// set some properties
<callGoal name="java:jar"/>
// set some more properties
<callGoal name="java:jar"/>
Though I'm not sure how 'reusable' the java:jar goals will be; it could well
be worth just creating your own parameterized custom goal and reusing those.
(Just as it might not be a good idea to start overwriting the POM objects
with different directories for each jar you're trying to create).
Maybe you could create new tag macros in Jelly for this kinda thing. Here's
an example of a tag which can be invoked to make a Jar...
<j:jelly xmlns:j="jelly:core" xmlns:define="jelly:define">
<!-- define a new tag -->
<define:taglib uri="myLib">
<define:tag name="makeJar">
<javac
destdir="${maven.build.dest}"
includes="${includes}"
excludes="${excludes}"
debug="${maven.compile.debug}"
deprecation="${maven.compile.deprecation}"
optimize="${maven.compile.optimize}">
<classpath>
<path refid="maven.dependency.classpath"/>
<pathelement path="${maven.build.dest}"/>
</classpath>
<jar
jarfile="${jarfile}"
basedir="${maven.build.dest}"
</jar>
</javac>
</define:tag>
</define:taglib>
// now lets use it
<my:makeJar includes="org/foo/bar/**/*.java"
jarfile="${maven.build.dest}/foo.jar"/>
<my:makeJar includes="org/foo/xyz/**/*.java"
jarfile="${maven.build.dest}/xyz.jar"/>
Even without creating new tags, just setting some variables, then invoking a
goal, should do the trick nicely. Providing the goal always reevaluates
itself.
James
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>