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

Create a rule for the reactor (ReactorModuleConvergence)

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.3.1
    • 1.4
    • Standard Rules
    • None

    Description

      It would be nice having a rule which checks the consitency of a multi-module build.

      Say having a build with modules like this:

      +-- root (pom.xml)
           +--- m1 (pom.xml)
                 +--- m11 (pom.xml)
                 +--- m12 (pom.xml)
           +--- m2 (pom.xml)
                 +--- m21 (pom.xml)
                 +--- m21 (pom.xml)
           +--- m3 (pom.xml)
                 +--- m31 (pom.xml)
                 +--- m31 (pom.xml)
           +--- m4 (pom.xml)
           +--- m5 (pom.xml)
      

      If you have for all modules the version 1.2.0-SNAPSHOT everything is fine.

      But what sometimes it happens that someone changes something and you will find things like the following:
      The module m21 (pom.xml) has a parent version of 1.1.0-SNAPSHOT instead of 1.2.0-SNAPSHOT which means maven will try to find this version in repository (you will get a warning during the build; But who reads warnings )..

      Or other things having module interdependencies and it happens someone does something like this:

      In m4 a dependency is written like this:

        <dependency>
         <groupId>TheGroup</groupId>
         <artifactId>m21</artifactId>
         <version>1.1.0-SNAPSHOT</version>
        </dependency>
      

      which will usually build (except your SNAPSHOT's have been deleted before), but it is not correct. or better like this:

        <dependency>
         <groupId>TheGroup</groupId>
         <artifactId>m21</artifactId>
         <version>1.1.0</version>
        </dependency>
      

      This means it will be solved against a released version which usually is not the intention in such cases.

      So the rule should check if the groupId/artifactId belongs to the reactor and check the consistency of the version of the dependencies etc. Also the parent would be nice.

      Attachments

        Issue Links

          Activity

            First working implementation r1577707.

            khmarbaise Karl Heinz Marbaise added a comment - First working implementation r1577707 .

            Enhanced docs in r1578123

            khmarbaise Karl Heinz Marbaise added a comment - Enhanced docs in r1578123

            Renamed rule according to the issue.
            r1578567

            khmarbaise Karl Heinz Marbaise added a comment - Renamed rule according to the issue. r1578567

            Enhanced docs r1612339.

            khmarbaise Karl Heinz Marbaise added a comment - Enhanced docs r1612339 .

            People

              khmarbaise Karl Heinz Marbaise
              khmarbaise Karl Heinz Marbaise
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: