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

requireProperty from active profiles are incorrectly mixed

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 3.0.0-M1
    • Fix Version/s: None
    • Component/s: Standard Rules
    • Labels:
      None
    • Environment:
      Apache Maven 3.3.9
      IBM J9 VM (build 2.8, JRE 1.8.0 Linux amd64-64 Compressed References 20170722_357405 (JIT enabled, AOT enabled)

      Description

      I have two profiles that both use the enforcer plugin to check some properties.

      • profile1 checks the property "test.user" for the value "tester"
      • profile2 checks that the property "inttest.user" is set.

      If either profile is enabled everything works fine.
      If both profiles are enabled the property "intest.user" is tested for the value "tester". That fails.

      The problem depends on the ordering of the profiles in the pom. If I move profile2 above profile1 everything works fine. Unfortunately I can't use this workaround in my real live project.

      Take the attached pom and run the following:

      mvn validate                        # OK
      mvn validate -Pprofile1             # OK
      mvn validate -Pprofile2             # OK
      mvn validate -Pprofile1 -Pprofile2  # FAILS
      

        Attachments

        1. pom.xml
          3 kB
          Ralf

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rakus Ralf
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: