[ 
https://issues.apache.org/jira/browse/MENFORCER-226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Elliotte Rusty Harold updated MENFORCER-226:
--------------------------------------------
    Description: 
When having a POM project with modules, using the {{requireActiveProfile}} rule 
on one of the modules fails to resolve profiles that are inherited from the 
parent.

I've attached 2 POMs to reproduce the problem:
- parent project defines a profile called {{one}} and enforces it to be active
- submodule does nothing, just inherits both

When ran with {{-P one}} parameter we get on the submodule (not the parent pom, 
which works fine):
{{\[WARNING\] Rule 0: org.apache.maven.plugins.enforcer.RequireActiveProfile 
failed with message:}}
{{Profile "one" is not activated.}}

If we run {{mvn -P one help:active-profiles}} we can observe that the profile 
is effectively activated on the submodule:
{{Active Profiles for Project 'example:-maven-subproject:jar:0.0.1-SNAPSHOT':}}

{{The following profiles are active:}}

 {{- default (source: external)}}
 {{- one (source: example:test-maven-project:0.0.1-SNAPSHOT)}}

  was:
When having a POM project with modules, using the {{requireActiveProfile}} rule 
on one of the modules fails to resolve those profiles that are inherited from 
the parent.

I've attached 2 POMs to reproduce the problem:
- parent project defines a profile called {{one}} and enforces it to be active
- submodule does nothing, just inherits both

When ran with {{-P one}} parameter we get on the submodule (not the parent pom, 
which works fine):
{{\[WARNING\] Rule 0: org.apache.maven.plugins.enforcer.RequireActiveProfile 
failed with message:}}
{{Profile "one" is not activated.}}

If we run {{mvn -P one help:active-profiles}} we can observe that the profile 
is effectively activated on the submodule:
{{Active Profiles for Project 'example:-maven-subproject:jar:0.0.1-SNAPSHOT':}}

{{The following profiles are active:}}

 {{- default (source: external)}}
 {{- one (source: example:test-maven-project:0.0.1-SNAPSHOT)}}


> requireActiveProfile ignores inherited profiles in submoduless
> --------------------------------------------------------------
>
>                 Key: MENFORCER-226
>                 URL: https://issues.apache.org/jira/browse/MENFORCER-226
>             Project: Maven Enforcer Plugin
>          Issue Type: Bug
>          Components: Standard Rules
>    Affects Versions: 1.4
>         Environment: Maven 3.2.2, JDK 7, Windows 7 64bit
>            Reporter: Yago Méndez Vidal
>            Priority: Minor
>         Attachments: pom.xml, pom.xml
>
>
> When having a POM project with modules, using the {{requireActiveProfile}} 
> rule on one of the modules fails to resolve profiles that are inherited from 
> the parent.
> I've attached 2 POMs to reproduce the problem:
> - parent project defines a profile called {{one}} and enforces it to be active
> - submodule does nothing, just inherits both
> When ran with {{-P one}} parameter we get on the submodule (not the parent 
> pom, which works fine):
> {{\[WARNING\] Rule 0: org.apache.maven.plugins.enforcer.RequireActiveProfile 
> failed with message:}}
> {{Profile "one" is not activated.}}
> If we run {{mvn -P one help:active-profiles}} we can observe that the profile 
> is effectively activated on the submodule:
> {{Active Profiles for Project 
> 'example:-maven-subproject:jar:0.0.1-SNAPSHOT':}}
> {{The following profiles are active:}}
>  {{- default (source: external)}}
>  {{- one (source: example:test-maven-project:0.0.1-SNAPSHOT)}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to