You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Brian E. Fox" <br...@reply.infinity.nu> on 2007/09/04 03:52:19 UTC

aggregator issues and enforcer

I have a few problems I need to work through before the next enforcer
release. 

 

First is that the enforce-once mojo declares @aggregator but still
executes for all children. (MENFORCER-12) Is this a bug in maven or are
aggregators still supposed to be inherited and executed? It doesn't seem
to make sense that you would want to aggregate at each level every time
even for things like site or archetypeNG:create-from-project.  If this
is how it's supposed to work, then I need to come up with another
solution to make enforce-once only run once each build. This should be
able to be set at the top parent but execute once and only once no
matter where you run the build (parent, child,grandchild etc) I'm
thinking that I might need to mess with the execution params in the
generated plexus config for the plugin. Any ideas?

 

The next one is sorta related to the first. I've added some rules that
require dependency resolution. Since there's currently no easy way to
resolve dependencies inside the mojo besides
@requiresDependencyResolution, I just set that. Unfortunately the
combination of aggregator and dependencyResolution is broken in maven
and causes all kinds of havoc (MNG-2277 / MENFORCER-11). One way I
thought to work around this is to make another enforcer goal like
enforce:dependencies and then allow the rules to declare they need
dependencies resolved and then warn and skip if they are configured to
execute inside the regular enforce-once goal. This workaround seems
kinda lame but even fixing MNG-2277 in 2.0.8 means it's still broken for
those with older versions which isn't good either. Suggestions?

 

Thanks,

Brian


Re: aggregator issues and enforcer

Posted by Brett Porter <br...@apache.org>.
On 04/09/2007, at 11:52 AM, Brian E. Fox wrote:

> I have a few problems I need to work through before the next enforcer
> release.
>
>
>
> First is that the enforce-once mojo declares @aggregator but still
> executes for all children. (MENFORCER-12) Is this a bug in maven or  
> are
> aggregators still supposed to be inherited and executed?

Sounds like a bug to me... is it better to just cache the result as  
the meaning of "once" instead of worrying about how many times Maven  
runs it?

> The next one is sorta related to the first. I've added some rules that
> require dependency resolution. Since there's currently no easy way to
> resolve dependencies inside the mojo besides
> @requiresDependencyResolution, I just set that. Unfortunately the
> combination of aggregator and dependencyResolution is broken in maven
> and causes all kinds of havoc (MNG-2277 / MENFORCER-11). One way I
> thought to work around this is to make another enforcer goal like
> enforce:dependencies and then allow the rules to declare they need
> dependencies resolved and then warn and skip if they are configured to
> execute inside the regular enforce-once goal. This workaround seems
> kinda lame but even fixing MNG-2277 in 2.0.8 means it's still  
> broken for
> those with older versions which isn't good either. Suggestions?

Yeah, unfortunately I think you might need to work around it...  
though having a dependencies goal does seem lame. Would changing the  
behaviour of enforce-once to not need the @aggregator be better?

- Brett
--
Brett Porter - brett@apache.org
Blog: http://www.devzuz.org/blogs/bporter/

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