I really like the idea of callbacks, but the idea of only being able to
have one target per callback seems like a limitation, especially if
plugins would start calling back to each other without the user knowing
it (I doubt this happens now because there hasn't been a problem with
it, but in my na�ve-ness, I would think it'd be a possibility to cut
down on duplicate implementations across plugins)

Instead of just setting a property, what if there was a task to append
your callback to the list of ones for the desired target? Something
like:

<add-callback source="pre-jar" buildFile="build.xml"
buildTarget="main"/>

The Java task could just take the maven.core.callback.pre-jar.buildFile
append the new target to whatever callback targets are already set in
the property.

I don't have enough experience with Ant tasks to know how the callback
would then get executed. Obviously another task would be involved to
split out the individual targets from the built-up callback string that
add-callback put together.

Perhaps something like:

<execute-callback source="jar"/>
<target name="do-jar" ... />

The execute-callback would loop through all of the pre-jar listeners,
execute do-jar, then loop through all of the post-jar listeners.

I can't think of a specific example of where multiple listeners for a
callback are needed, other than it's more elegant and powerful than the
existing solution. Not the existing solution isn't powerful; I've been
very impressed by everything maven can do.

- Stephen



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to