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

Profiles in profiles.xml not activated properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.9
    • None
    • Profiles
    • None
    • Windows XP Professional

    Description

      I created a profiles.xml file with three profiles in it as shown below. When I execute a Maven command like:

      >mvn -f <path-to-basedir>\pom.xml -PconwebDev ...

      the properties defined by profile conwebFinal are used. I shuffled the profiles around in the file and whichever one was defined last was the one whose values took effect. It seems as if all profiles are being activated and the last one wins.

      When I put these same profiles in settings.xml or inside the main pom.xml, everything works properly.

      Here are the profiles:

      <profiles>
      <!-- conweb Project-specific profiles -->
      <profile>
      <id>conwebDev</id>
      <properties>
      <app.properties>conweb.properties</app.properties>
      <app.version.qualifier>DEV</app.version.qualifier>
      </properties>
      </profile>

      <profile>
      <id>conwebTest</id>
      <properties>
      <app.properties>conweb.properties</app.properties>
      <app.version.qualifier>TEST</app.version.qualifier>
      </properties>
      </profile>

      <profile>
      <id>conwebFinal</id>
      <properties>
      <app.properties>conweb.properties</app.properties>
      <app.version.qualifier>FINAL</app.version.qualifier>
      </properties>
      </profile>
      </profiles>

      Attachments

        Issue Links

          Activity

            People

              bentmann Benjamin Bentmann
              waltbarrow Walt Barrow
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: