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

Cannot resolve active profile name at build time

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 3.0
    • None
    • Profiles
    • None
    • Mac OS 10.6

    Description

      I have a maven profile defined in my pom. It's not active by default, so I run -P <profilename>.
      When the profile is running, I want to construct a path that includes the name of the profile. I've looked online and it appears that

      http://stackoverflow.com/questions/2012198/maven-can-i-reference-profile-id-in-profile-definition

      would have the answer. Alas, it doesn't work for me at build time. If I do a mvn help:evaluate -P <profilename> and use ${projects.activeProfiles[0].id}, I get the value I would expect. When I run in the build, though, it doesn't resolve and just uses the literal value in the path.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ribone Richard Bone
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: