You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mario Jauvin (Jira)" <ji...@apache.org> on 2021/02/18 14:08:00 UTC

[jira] [Updated] (MNG-7101) maven profiles activated by default get turned off when one profile is activated by property

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

Mario Jauvin updated MNG-7101:
------------------------------
    Description: 
I have this simple pom file:
{noformat}
 <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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.maven</groupId>
  <artifactId>MNG-XXXX</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <profiles>
    <profile>
      <id>always1</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
    </profile>
    <profile>
      <id>propa</id>
      <activation>
        <property>
          <name>propa</name>
        </property>
      </activation>
    </profile>
  </profiles>
</project>{noformat}
When I run mvn help:active-profiles I get:
{noformat}
 [INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< org.apache.maven:MNG-XXXX >----------------------
[INFO] Building MNG-XXXX 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-help-plugin:3.2.0:active-profiles (default-cli) @ MNG-XXXX ---
[INFO] 
Active Profiles for Project 'org.apache.maven:MNG-XXXX:jar:0.0.1-SNAPSHOT':

The following profiles are active:

 - always1 (source: org.apache.maven:MNG-XXXX:0.0.1-SNAPSHOT)



[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.544 s
[INFO] Finished at: 2021-02-18T08:58:23-05:00
[INFO] ------------------------------------------------------------------------
{noformat}
When I run mvn -Dprofa help:active-profiles I get this:
{noformat}
 [INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< org.apache.maven:MNG-XXXX >----------------------
[INFO] Building MNG-XXXX 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-help-plugin:3.2.0:active-profiles (default-cli) @ MNG-XXXX ---
[INFO] 
Active Profiles for Project 'org.apache.maven:MNG-XXXX:jar:0.0.1-SNAPSHOT':

The following profiles are active:

 - profa (source: org.apache.maven:MNG-XXXX:0.0.1-SNAPSHOT)


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.544 s
[INFO] Finished at: 2021-02-18T08:58:23-05:00
[INFO] ------------------------------------------------------------------------
{noformat}
This is wrong, I should get always1 and profa.

  was:
I have this simple pom file:
{noformat}
 <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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.maven</groupId>
  <artifactId>MNG-XXXX</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <profiles>
    <profile>
      <id>always1</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
    </profile>
    <profile>
      <id>propa</id>
      <activation>
        <property>
          <name>propa</name>
        </property>
      </activation>
    </profile>
  </profiles>
</project>{noformat}
When I run mvn help:active-profiles I get:
{noformat}
 [INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< org.apache.maven:MNG-XXXX >----------------------
[INFO] Building MNG-XXXX 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-help-plugin:3.2.0:active-profiles (default-cli) @ MNG-XXXX ---
[INFO] 
Active Profiles for Project 'org.apache.maven:MNG-XXXX:jar:0.0.1-SNAPSHOT':

The following profiles are active:

 - always1 (source: org.apache.maven:MNG-XXXX:0.0.1-SNAPSHOT)



[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.544 s
[INFO] Finished at: 2021-02-18T08:58:23-05:00
[INFO] ------------------------------------------------------------------------
{noformat}
When I run mvn -Dprofa help:active-profiles I get this:
{noformat}
 [INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< org.apache.maven:MNG-XXXX >----------------------
[INFO] Building MNG-XXXX 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-help-plugin:3.2.0:active-profiles (default-cli) @ MNG-XXXX ---
[INFO] 
Active Profiles for Project 'org.apache.maven:MNG-XXXX:jar:0.0.1-SNAPSHOT':

The following profiles are active:

 - profa (source: org.apache.maven:MNG-XXXX:0.0.1-SNAPSHOT)


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.544 s
[INFO] Finished at: 2021-02-18T08:58:23-05:00
[INFO] ------------------------------------------------------------------------
{noformat}
This is wrong, I should get always1 and profa.


> maven profiles activated by default get turned off when one profile is activated by property
> --------------------------------------------------------------------------------------------
>
>                 Key: MNG-7101
>                 URL: https://issues.apache.org/jira/browse/MNG-7101
>             Project: Maven
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 3.6.3
>         Environment: Windows 10, maven 3.6.3
>            Reporter: Mario Jauvin
>            Priority: Critical
>
> I have this simple pom file:
> {noformat}
>  <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">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>org.apache.maven</groupId>
>   <artifactId>MNG-XXXX</artifactId>
>   <version>0.0.1-SNAPSHOT</version>
>   <profiles>
>     <profile>
>       <id>always1</id>
>       <activation>
>         <activeByDefault>true</activeByDefault>
>       </activation>
>     </profile>
>     <profile>
>       <id>propa</id>
>       <activation>
>         <property>
>           <name>propa</name>
>         </property>
>       </activation>
>     </profile>
>   </profiles>
> </project>{noformat}
> When I run mvn help:active-profiles I get:
> {noformat}
>  [INFO] Scanning for projects...
> [INFO] 
> [INFO] ---------------------< org.apache.maven:MNG-XXXX >----------------------
> [INFO] Building MNG-XXXX 0.0.1-SNAPSHOT
> [INFO] --------------------------------[ jar ]---------------------------------
> [INFO] 
> [INFO] --- maven-help-plugin:3.2.0:active-profiles (default-cli) @ MNG-XXXX ---
> [INFO] 
> Active Profiles for Project 'org.apache.maven:MNG-XXXX:jar:0.0.1-SNAPSHOT':
> The following profiles are active:
>  - always1 (source: org.apache.maven:MNG-XXXX:0.0.1-SNAPSHOT)
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time:  2.544 s
> [INFO] Finished at: 2021-02-18T08:58:23-05:00
> [INFO] ------------------------------------------------------------------------
> {noformat}
> When I run mvn -Dprofa help:active-profiles I get this:
> {noformat}
>  [INFO] Scanning for projects...
> [INFO] 
> [INFO] ---------------------< org.apache.maven:MNG-XXXX >----------------------
> [INFO] Building MNG-XXXX 0.0.1-SNAPSHOT
> [INFO] --------------------------------[ jar ]---------------------------------
> [INFO] 
> [INFO] --- maven-help-plugin:3.2.0:active-profiles (default-cli) @ MNG-XXXX ---
> [INFO] 
> Active Profiles for Project 'org.apache.maven:MNG-XXXX:jar:0.0.1-SNAPSHOT':
> The following profiles are active:
>  - profa (source: org.apache.maven:MNG-XXXX:0.0.1-SNAPSHOT)
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time:  2.544 s
> [INFO] Finished at: 2021-02-18T08:58:23-05:00
> [INFO] ------------------------------------------------------------------------
> {noformat}
> This is wrong, I should get always1 and profa.



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