Peter De Maeyer created MENFORCER-477:
-----------------------------------------

             Summary: failWhenParentIsSnapshot does not respect onlyWhenRelease
                 Key: MENFORCER-477
                 URL: https://issues.apache.org/jira/browse/MENFORCER-477
             Project: Maven Enforcer Plugin
          Issue Type: Bug
    Affects Versions: 3.2.1
            Reporter: Peter De Maeyer


I have a snapshot project that has a snapshot parent.

At release time, I want to use the enforcer plugin to make sure the release 
version of my project only depends on release versions, including the parent. 
So I use{{failWhenParentIsSnapshot=true}}.

For snapshot versions of my project, I want to _allow_ snapshot dependencies 
including snapshot parent, so I use {{onlyWhenRelease=true}} to disable the 
enforcer for snapshot versions.

Expected: my snapshot project build succeeds with a snapshot parent.

Actual: my snapshot project build _fails_ with a snapshot parent, despite the 
{{onlyWhenRelease=true}}.

I suspect that {{failWhenParentIsSnapshot}} does not take the 
{{onlyWhenRelease}} into account.

The intuitive fix for me would be that the combination of both options behaves 
as expected.

I imagine that maybe it is a design choice to keep both options completely 
independent of each other, so an acceptable alternative for me would be to 
introduce yet another option, e.g. {{onlyWhenParentIsRelase}} that behaves 
similar to {{onlyWhenRelease}} but applies to the parent only.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to