[ 
https://issues.apache.org/jira/browse/MNG-8360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17892724#comment-17892724
 ] 

Guillaume Nodet commented on MNG-8360:
--------------------------------------

So the problem is not exactly the one described.  The profiles are indeed 
activated, but are not reported as such.

If the profiles are modified to be:
{code}
    <profiles>
        <profile>
            <id>profile_active_by_default</id>
            <activation>
              <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <profile_active_by_default>active</profile_active_by_default>
            </properties>
        </profile>
        <profile>
            <id>profile_active_from_mvn_config</id>
            <properties>
                
<profile_active_from_mvn_config>active</profile_active_from_mvn_config>
            </properties>
        </profile>
        <profile>
            <id>profile_active_from_condition</id>
            <activation>
              <property>
                <name>profile_active_from_condition</name>
              </property>
            </activation>
            <properties>
                
<profile_active_from_condition>active</profile_active_from_condition>
            </properties>
        </profile>
{code}

then displaying the effective poms using {{help:effective-pom -Dverbose}} leads 
to:
{code}
  <!-- ====================================================================== 
-->
  <!--                                                                        
-->
  <!-- Effective POM for project                                              
-->
  <!-- 'com.github.mattnelson:module1:pom:1.0.0-SNAPSHOT'                     
-->
  <!--                                                                        
-->
  <!-- ====================================================================== 
-->
  <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd"; 
child.project.url.inherit.append.path="false">
    <modelVersion>4.0.0</modelVersion>  <!-- 
com.github.mattnelson:module1:1.0.0-SNAPSHOT, line 3 -->
    <parent>
      <groupId>com.github.mattnelson</groupId>  <!-- 
com.github.mattnelson:module1:1.0.0-SNAPSHOT, line 5 -->
      <artifactId>profiles</artifactId>  <!-- 
com.github.mattnelson:module1:1.0.0-SNAPSHOT, line 6 -->
      <version>1.0.0-SNAPSHOT</version>  <!-- 
com.github.mattnelson:module1:1.0.0-SNAPSHOT, line 7 -->
      <relativePath>..</relativePath>
    </parent>
    <groupId>com.github.mattnelson</groupId>  <!-- 
com.github.mattnelson:module1:1.0.0-SNAPSHOT, line 9 -->
    <artifactId>module1</artifactId>  <!-- 
com.github.mattnelson:module1:1.0.0-SNAPSHOT, line 10 -->
    <version>1.0.0-SNAPSHOT</version>  <!-- 
com.github.mattnelson:module1:1.0.0-SNAPSHOT, line 11 -->
    <packaging>pom</packaging>  <!-- 
com.github.mattnelson:module1:1.0.0-SNAPSHOT, line 12 -->
    <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  <!-- 
org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, line 27 
-->
      
<project.build.outputTimestamp>1980-02-01T00:00:00Z</project.build.outputTimestamp>
  <!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 30 -->
      <profile_active_from_mvn_config>active</profile_active_from_mvn_config>  
<!-- com.github.mattnelson:profiles:${revision}, line 27 -->
      <profile_active_from_condition>active</profile_active_from_condition>  
<!-- com.github.mattnelson:profiles:${revision}, line 38 -->
      
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>  
<!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 28 -->
      <revision>1.0.0-SNAPSHOT</revision>  <!-- 
com.github.mattnelson:profiles:${revision}, line 9 -->
    </properties>
    <build>
      
<sourceDirectory>/Users/gnodet/tmp/maven-examples/module1/src/main/java</sourceDirectory>
  <!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 38 -->
      
<scriptSourceDirectory>/Users/gnodet/tmp/maven-examples/module1/src/main/scripts</scriptSourceDirectory>
  <!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 39 -->
      
<testSourceDirectory>/Users/gnodet/tmp/maven-examples/module1/src/test/java</testSourceDirectory>
  <!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 40 -->
      
<outputDirectory>/Users/gnodet/tmp/maven-examples/module1/target/classes</outputDirectory>
  <!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 35 -->
      
<testOutputDirectory>/Users/gnodet/tmp/maven-examples/module1/target/test-classes</testOutputDirectory>
  <!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 37 -->
      <resources>
        <resource>
          
<directory>/Users/gnodet/tmp/maven-examples/module1/src/main/resources</directory>
  <!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 43 -->
        </resource>
        <resource>
          <filtering>true</filtering>  <!-- 
org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, line 47 
-->
          
<directory>/Users/gnodet/tmp/maven-examples/module1/src/main/resources-filtered</directory>
  <!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 46 -->
        </resource>
      </resources>
      <testResources>
        <testResource>
          
<directory>/Users/gnodet/tmp/maven-examples/module1/src/test/resources</directory>
  <!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 52 -->
        </testResource>
        <testResource>
          <filtering>true</filtering>  <!-- 
org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, line 56 
-->
          
<directory>/Users/gnodet/tmp/maven-examples/module1/src/test/resources-filtered</directory>
  <!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 55 -->
        </testResource>
      </testResources>
      <directory>/Users/gnodet/tmp/maven-examples/module1/target</directory>  
<!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 34 -->
      <finalName>module1-1.0.0-SNAPSHOT</finalName>  <!-- 
org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, line 36 
-->
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.2.0</version>
          <executions>
            <execution>
              <id>default-clean</id>
              <phase>clean</phase>
              <goals>
                <goal>clean</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>  <!-- 
org.apache.maven:maven-core:4.0.0-beta-6-SNAPSHOT:default-lifecycle-bindings -->
          <version>3.1.1</version>  <!-- 
org.apache.maven:maven-core:4.0.0-beta-6-SNAPSHOT:default-lifecycle-bindings -->
          <executions>
            <execution>
              <id>default-install</id>  <!-- 
org.apache.maven:maven-core:4.0.0-beta-6-SNAPSHOT:default-lifecycle-bindings -->
              <phase>install</phase>  <!-- 
org.apache.maven:maven-core:4.0.0-beta-6-SNAPSHOT:default-lifecycle-bindings -->
              <goals>
                <goal>install</goal>  <!-- 
org.apache.maven:maven-core:4.0.0-beta-6-SNAPSHOT:default-lifecycle-bindings -->
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>  <!-- 
org.apache.maven:maven-core:4.0.0-beta-6-SNAPSHOT:default-lifecycle-bindings -->
          <version>3.1.1</version>  <!-- 
org.apache.maven:maven-core:4.0.0-beta-6-SNAPSHOT:default-lifecycle-bindings -->
          <executions>
            <execution>
              <id>default-deploy</id>  <!-- 
org.apache.maven:maven-core:4.0.0-beta-6-SNAPSHOT:default-lifecycle-bindings -->
              <phase>deploy</phase>  <!-- 
org.apache.maven:maven-core:4.0.0-beta-6-SNAPSHOT:default-lifecycle-bindings -->
              <goals>
                <goal>deploy</goal>  <!-- 
org.apache.maven:maven-core:4.0.0-beta-6-SNAPSHOT:default-lifecycle-bindings -->
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.12.1</version>
          <executions>
            <execution>
              <id>default-site</id>
              <phase>site</phase>
              <goals>
                <goal>site</goal>
              </goals>
            </execution>
            <execution>
              <id>default-deploy</id>
              <phase>site-deploy</phase>
              <goals>
                <goal>deploy</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>
    <reporting>
      
<outputDirectory>/Users/gnodet/tmp/maven-examples/module1/target/site</outputDirectory>
  <!-- org.apache.maven:maven-api-impl:4.0.0-beta-6-SNAPSHOT:super-pom-4.0.0, 
line 62 -->
    </reporting>
  </project>
{code}

where we can see:
{code}
      <profile_active_from_mvn_config>active</profile_active_from_mvn_config>  
<!-- com.github.mattnelson:profiles:${revision}, line 27 -->
      <profile_active_from_condition>active</profile_active_from_condition>  
<!-- com.github.mattnelson:profiles:${revision}, line 38 -->
{code}

so the profiles are actually activated on the child module.

They should be reported as such.


> Profile activation regression in beta5
> --------------------------------------
>
>                 Key: MNG-8360
>                 URL: https://issues.apache.org/jira/browse/MNG-8360
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 4.0.0-beta-5
>            Reporter: Matt Nelson
>            Assignee: Guillaume Nodet
>            Priority: Major
>             Fix For: 4.0.0-beta-6
>
>
> Profile activation for submodules is no longer working with 4.0.0-beta-5, it 
> was working with 4.0.0-beta-4.
> Reproducer
> https://github.com/mattnelson/maven-examples/tree/profile_activation
> beta4
> {noformat}
> [INFO] --- help:3.5.1:active-profiles (default-cli) @ profiles ---
> [INFO]
> Active Profiles for Project 
> 'com.github.mattnelson:profiles:pom:1.0.0-SNAPSHOT':
> The following profiles are active:
>  - settings-xml-activeProfiles (source: external)
>  - profile_active_from_mvn_config (source: 
> /Users/Shared/DevBuild/code/maven-examples/pom.xml)
> Active Profiles for Project 
> 'com.github.mattnelson:module1:pom:1.0.0-SNAPSHOT':
> The following profiles are active:
>  - settings-xml-activeProfiles (source: external)
>  - profile_active_from_mvn_config (source: 
> /Users/Shared/DevBuild/code/maven-examples/pom.xml)
> {noformat}
> beta5
> {noformat}
> [INFO] --- help:3.5.1:active-profiles (default-cli) @ profiles ---
> [INFO]
> Active Profiles for Project 
> 'com.github.mattnelson:profiles:pom:1.0.0-SNAPSHOT':
> The following profiles are active:
>  - settings-xml-activeProfiles (source: external)
>  - profile_active_from_mvn_config (source: 
> com.github.mattnelson:profiles:pom:1.0.0-SNAPSHOT)
>  - profile_active_from_condition (source: 
> com.github.mattnelson:profiles:pom:1.0.0-SNAPSHOT)
> Active Profiles for Project 
> 'com.github.mattnelson:module1:pom:1.0.0-SNAPSHOT':
> The following profiles are active:
>  - settings-xml-activeProfiles (source: external)
> {noformat}



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

Reply via email to