Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5685

Profile with multiple conditions gets activated incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.2.2, 3.2.3
    • None
    • None
    • None

    Description

      Consider the following simple profile:

              ...
              <profile>
                  <id>some-profile</id>
                  <activation>
                      <property>
                          <name>!skipTests</name>
                      </property>
                      <activeByDefault>false</activeByDefault>
                  </activation>
                  ...
              <profile>
              ...
      

      I would expect that this profile will not be active by default. Furthermore, it will not be active if the tests are skipped.

      However, if you execute:

      mvn help:active-profiles
      

      you will see:

      [INFO] Scanning for projects...
      [INFO]                                                                         
      [INFO] ------------------------------------------------------------------------
      [INFO] Building foo-bar: baz 1.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO] 
      [INFO] --- maven-help-plugin:2.2:active-profiles (default-cli) @ org.foo.bar:baz ---
      [INFO] 
      Active Profiles for Project 'org.foo.bar:baz:jar:1.0-SNAPSHOT': 
      
      The following profiles are active:
      
       - some-profile (source: org.foo.bar:baz:1.0-SNAPSHOT)
      
      

      If you pass in -DskipTests, the profile gets disabled, but you shouldn't have to do this.

      I believe this is related to MNG-4565.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              carlspring Martin Todorov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: