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

profiles should be merged when inherited

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 2.0.4
    • None
    • None

    Description

      I have some default profiles setup in a super parent pom that all projects inherit from. In some projects I want to change the active profile, but not from the CLI because other projects running in the same multi-project build need to have the normal default. I attempted to work around this by setting the profile to be active on a property in the child pom. See below for parent and child. It appears that when I do this, the child profile replaces the parent. It should be merged so that the properties are pulled from the parent and uses the activation from the child.

      parent:
      <!-- Setup default profiles. -->
      <profiles>
      <profile>
      <id>dev</id>
      <properties>
      <profile-default.values>src/main/filters/dev-default.values</profile-default.values>
      </properties>
      </profile>
      <profile>
      <id>auto-test</id>
      <properties>
      <profile-default.values>src/main/filters/auto-test-default.values</profile-default.values>
      </properties>
      </profile>
      <profile>
      <id>man-test</id>
      <properties>
      <profile-default.values>src/main/filters/man-test-default.values</profile-default.values>
      </properties>
      </profile>
      <profile>
      <id>prod</id>
      <properties>
      <profile-default.values>src/main/filters/prod-default.values</profile-default.values>
      </properties>
      </profile>
      </profiles>

      child pom..

      <!-- This is the property to override for custom properties in this project-->
      <properties>
      <client-ct-package.values>${user.default.values}</client-ct-package.values>
      </properties>
      <build>
      <filters>
      <filter>${profile-default.values}</filter>
      <filter>${user.default.values}</filter>
      <filter>${client-ct-package.values}</filter>
      </filters>
      <resources>
      <resource>
      <directory>src/main/resources</directory>
      <filtering>true</filtering>
      </resource>
      </resources>
      </build>
      <!-- temporary to activate the CT production values until all projects can have prod values -->
      <profiles>
      <profile>
      <id>prod</id>
      <activation>
      <property>
      <name>deploy-ct</name>
      </property>
      </activation>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              brianf Brian E Fox
              Votes:
              6 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: