[ https://issues.apache.org/jira/browse/MENFORCER-477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter De Maeyer updated MENFORCER-477: -------------------------------------- Description: 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 {{onlyWhenRelease=true}}. I suspect that {{failWhenParentIsSnapshot}} does not take {{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. {{onlyWhenParentIsRelease}} that behaves similar to {{onlyWhenRelease}} but applies to the parent only. was: 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 {{onlyWhenRelease=true}}. I suspect that {{failWhenParentIsSnapshot}} does not take {{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. {{onlyWhenParentIsRelease}} that behaves similar to {{onlyWhenRelease}} but applies to the parent only. > 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 > Priority: Major > > 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 > {{onlyWhenRelease=true}}. > I suspect that {{failWhenParentIsSnapshot}} does not take {{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. {{onlyWhenParentIsRelease}} that behaves > similar to {{onlyWhenRelease}} but applies to the parent only. -- This message was sent by Atlassian Jira (v8.20.10#820010)