Uploaded image for project: 'Maven Enforcer Plugin'
  1. Maven Enforcer Plugin
  2. MENFORCER-226

requireActiveProfile ignores inherited profiles in submoduless

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.4
    • None
    • Standard Rules
    • None
    • Maven 3.2.2, JDK 7, Windows 7 64bit

    Description

      When having a POM project with modules, using the requireActiveProfile rule on one of the modules fails to resolve profiles that are inherited from the parent.

      I've attached 2 POMs to reproduce the problem:

      • parent project defines a profile called one and enforces it to be active
      • submodule does nothing, just inherits both

      When ran with -P one parameter we get on the submodule (not the parent pom, which works fine):
      [WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireActiveProfile failed with message:
      Profile "one" is not activated.

      If we run mvn -P one help:active-profiles we can observe that the profile is effectively activated on the submodule:
      Active Profiles for Project 'example:-maven-subproject:jar:0.0.1-SNAPSHOT':

      The following profiles are active:

      - default (source: external)
      - one (source: example:test-maven-project:0.0.1-SNAPSHOT)

      Attachments

        1. pom.xml
          1 kB
          Yago Méndez Vidal
        2. pom.xml
          0.4 kB
          Yago Méndez Vidal

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              dsmania Yago Méndez Vidal
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: