Uploaded image for project: 'Maven Help Plugin'
  1. Maven Help Plugin
  2. MPH-94

MavenProject.getActiveProfiles() does not merge active profiles from parent POMs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      Profiles from parent pom's are internally merged, but getActiveProfiles() doesn't return them as long as they aren't redefined in the module.

      The zip contains two poms with some profiles:

      buggy-profiles (activate-me, active-by-default, shared-profile)
      + buggy-module (module-activate-me, module-active-by-default, shared-profile)

      Each of the profiles adds a "echo ..." to the validate-phase.

      mvn validate help:active-profiles
      ------------------------------------------------------------------------
      Building buggy-pom 1.0-SNAPSHOT
      ------------------------------------------------------------------------
      
      --- exec-maven-plugin:1.1:exec (active-by-default) @ buggy-pom ---
      "### running 'active-by-default'"
      
      ------------------------------------------------------------------------
      Building buggy-module 1.0-SNAPSHOT
      ------------------------------------------------------------------------
      
      --- exec-maven-plugin:1.1:exec (active-by-default) @ buggy-module ---
      "### running 'active-by-default'"
      
      --- exec-maven-plugin:1.1:exec (module-active-by-default) @ buggy-module ---
      "### running 'module-active-by-default'"
      ..
      ..
      Active Profiles for Project 'test:buggy-pom:pom:1.0-SNAPSHOT':
      
      The following profiles are active:
      
       - active-by-default (source: pom)
       - netcologne.default (source: settings.xml)
      
      
      
      Active Profiles for Project 'test:buggy-module:pom:1.0-SNAPSHOT':
      
      The following profiles are active:
      
       - module-active-by-default (source: pom)
       - netcologne.default (source: settings.xml)
      

      The module should also list 'active-by-default'. Even more since it is also run correctly.

      Explicitely activated profiles behave the same:

      mvn validate help:active-profiles -P activate-me, module-activate-me

      When the a profile is redefined in the module (without any changes) the active-profiles list is correct:

      
      

      mvn validate help:active-profiles -P activate-me, module-activate-me

      
      

      Attachments

        1. buggy-profiles.zip
          2 kB
          Lars Corneliussen

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              lcorneliussen Lars Corneliussen
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: