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

Priority for profiles activated by property or -P unclear

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0.9
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I could not find the situation documented somewhere, but the current behaviour is against my excpectation, hence a low priority bug report. In my pom, I have two profiles. One is activated by the -P command line option, the other by an environment variable. In variation of the example in MNG-2309:

      <profile>
        <id>default</id>
        <activation>
          <property>
            <name>env.WORKSPACE</name>
          </property>
        </activation>
        <properties>
          <test>DEFAULT</test>
        </properties>
      </profile>
      
      <profile>
        <id>override</id>
        <properties>
          <test>OVERRIDE</test>
        </properties>
      </profile>
      

      env.WORKSPACE is set by Hudson, when the build is executed. When Hudson runs "mvn -P override" I would expect test set to override. As I said, this is my expectation, and I don't know if it was a consious design decision to make the priority of profile activation differently.

        Attachments

        1. pom.xml
          1 kB
          Benjamin Bentmann

          Issue Links

            Activity

              People

              • Assignee:
                bentmann Benjamin Bentmann
                Reporter:
                andreasek Andreas Ebbert-Karroum
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: