[ 
https://jira.codehaus.org/browse/MENFORCER-185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=358960#comment-358960
 ] 

Curtis Rueden commented on MENFORCER-185:
-----------------------------------------

Thanks for the quick reply, Karl. I want to clarify that this is a fringe issue 
for my group's projects, since we have switched almost completely to 
single-module projects in separate Git repositories. We have only a couple of 
multi-module projects left that get bitten. That said, I agree with the OP that 
if you have a 100-module build, and it is important that it have only release 
dependencies outside the reactor, it would be awesome if this rule could 
support that use case. My personal tack would be to add another boolean 
property {{allowSnapshotsInReactor}} which defaults to {{false}} for backwards 
compatibility, but can be set to {{true}} to get the desired behavior.

Looking at the source, I wouldn't think a full rewrite is required, but rather 
some case logic carefully injected in a couple of places. For example, in 
{{RequireReleaseDeps.java}}, in the {{if ( failWhenParentIsSnapshot )}} block, 
do not throw the exception if {{allowSnapshotsInReactor}} is set and the parent 
is part of the multi-module build. And in the {{checkDependencies}} method, do 
not add the artifact to the {{foundSnapshots}} structure if the artifact is 
part of the multi-module build.

I'm certainly no expert on the codebase though, so perhaps it is more 
complicated than that.

> Require Release Dependencies ignorant about aggregator build
> ------------------------------------------------------------
>
>                 Key: MENFORCER-185
>                 URL: https://jira.codehaus.org/browse/MENFORCER-185
>             Project: Maven Enforcer Plugin
>          Issue Type: Bug
>          Components: Standard Rules
>    Affects Versions: 1.3.1
>            Reporter: Thomas Diesler
>         Attachments: seuss.zip
>
>
> If A depends on B it is ok for A-1.0.0-SNAPSHOT to have snapshot dependency 
> on B-1.0.0-SNAPSHOT if B was build before A during the same reactor build.
> Using the requireReleaseDeps rule it seems that SNAPSHOTS are generally not 
> allowed even when they belong to the same project and were built during the 
> same reactor build.
> We have a complex project with 100+ modules. I want to enforce that no module 
> has dependencies on project SNAPSHOTS that were not included in the build. In 
> such case A would use a stale version of B that happened to be available in 
> the local/remote maven repository.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to