maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <>
Subject A subtlety with forked executions, looking for advice
Date Tue, 01 Jan 2013 13:58:55 GMT
In the license-maven-plugin, there is a goal called 'aggregate-add-third-party'.

until this morning, it was annotated with:

 @Execute( goal = "add-third-party" )

This caused a problem. The add-third-party Mojo can read data from
dependencies. So, if module (a) attached a resource, and module (b)
went to read that resource in add-third-party, it failed. Why?

Well, 'add-third-party' is not part of a lifecycle. So forking it
executes nothing else. So, the dependency wasn't there in the reactor.

Even if, by the way, the dependency was attached in an earlier phase
than the aggregate-add-third-party, it didn't help, since the fork
happens in the aggregating project before the modules happen.

One solution to this is to add phase = SOMETHING to that @Execute, so
that the execution that produces the resource has somewhere to live.
Since the default phase for aggregate-add-third-party of
generate-resources, does generate-resources lead to a risk of
something circular?

I suppose that another would be to define an entire lifecycle, and
thus create a phase just for the purpose of allowing things to happen
that feed add-third-party. Now the plugin would need to be listed as
an extension, which is a pain.

Anyone have another suggestion?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message