Maven 1.x Multi-Project Plugin
  1. Maven 1.x Multi-Project Plugin
  2. MPMULTIPROJECT-71

CLONE -goal multiproject:create-nav seems to have lost pom.id

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      maven 1.0.2 but with a couple of plugins upgraded to latest HEAD.
    • Number of attachments :
      1

      Description

      Today I have upgraded the checkstyle plugin to 3.0 from 2.6
      This seems to have downloaded a couple of libraries and I now have a strange behaviour for multiproject.

      I have also upgraded PMD to 1.8-SNAPSHOT but the following issue appeared before:

      When I run "maven multiproject:site", the reactor goes through all sub-projects ok BUT when it reaches the call to <attainGoal name="multiproject:create-nav"/>, it seems to lose the pom.id and declares that I must exclude the XXXX (the top level project" (see line 140 in th eplugin.jelly).

      XXXX, which is the pom.id, is replaced by the LAST project contained in the variable $

      {multiprojects}.

      the pom.id seems to have changed between the line just BEFORE the call to multiproject:create-nav and the FIRST line inside create-nav.

      If I modify the code to add some log:
      <echo>POM.id before calling create-nav ${pom.id}</echo>
      <attainGoal name="multiproject:create-nav"/>
      ...

      <goal name="multiproject:create-nav"
      prereqs="multiproject:site-init">

      <echo>POM.id INSIDE create-nav ${pom.id} and multi ${multiprojects}

      </echo>
      <j:forEach var="reactorProject" items="$

      {multiprojects}

      ">
      <echo>POM.id INSIDE LOOP create-nav $

      {pom.id} and current ${reactorProject.id}</echo>
      <j:if test="${reactorProject.id == pom.id}">
      <fail message="You must exclude ${pom.id}

      (the top level project) from the subproject set"/>
      </j:if>
      </j:forEach>

      The pom.id has changed between the first 2 echos. it then matches the last reactorProject.id and th ewhole process fails.

      I do not understand why the pom.id is changed somewhere in multiproject:site-init...

      My current workaround is to change the <fail to a simple <echo so that the process can finish (but it does not generate a proper navigation.xml)

      There is obviously something wrong introduced by the latest download of a couple of plugin, I still have maven 1.0.2

      Is there a way I could list all plugins and version? I would post it here...

      Thanks for looking into it.

      Benoit

        Issue Links

          Activity

          Hide
          Rupert Smith added a comment -

          I re-opened this issue because MPMULTIPROJECT-64 was closed due to not being reproducable.

          I am attaching a test.zip file containing a sample project to reproduce it. There are two sub-projects in this test.zip, dummy and mavenbuild. The mavenbuild project is the master POM and dummy is a trivial project with just one java class in it. Run multiproject:site form the mavenbuild directory to reproduce the bug. Note that the maven-checkstyle-plugin-3.0.1.jar supplied in the root of the test.zip file must be installed too.

          To see it working without the bug, comment out the checkstyle report entry from the project.xml in the mavenbuild directory.

          Hope this helps.

          P.S. I looked into the checkstyle plugin.jelly but I can't see where that would change pom.id?

          Show
          Rupert Smith added a comment - I re-opened this issue because MPMULTIPROJECT-64 was closed due to not being reproducable. I am attaching a test.zip file containing a sample project to reproduce it. There are two sub-projects in this test.zip, dummy and mavenbuild. The mavenbuild project is the master POM and dummy is a trivial project with just one java class in it. Run multiproject:site form the mavenbuild directory to reproduce the bug. Note that the maven-checkstyle-plugin-3.0.1.jar supplied in the root of the test.zip file must be installed too. To see it working without the bug, comment out the checkstyle report entry from the project.xml in the mavenbuild directory. Hope this helps. P.S. I looked into the checkstyle plugin.jelly but I can't see where that would change pom.id?
          Hide
          Rupert Smith added a comment -

          Here's the test project to reproduce the bug with.

          Show
          Rupert Smith added a comment - Here's the test project to reproduce the bug with.
          Hide
          Rupert Smith added a comment -

          I attached a note to MPMULTIPROJECT-64 to say that this is caused by upgrading checkstyle plugin. Everything worked fine before I upgraded my checkstyle, but I needed to do that to get checktyle working properly on Java 1.5 syntax.

          Workarounds: don't use checkstyle reports. Stick with older versions on checkstyle.

          This may be a bug with the checkstyle plugin and not the multiproject plugin, suggest that once the culprit is identified the bug report be moved to the appropriate plugin for fixing.

          Rupert

          Show
          Rupert Smith added a comment - I attached a note to MPMULTIPROJECT-64 to say that this is caused by upgrading checkstyle plugin. Everything worked fine before I upgraded my checkstyle, but I needed to do that to get checktyle working properly on Java 1.5 syntax. Workarounds: don't use checkstyle reports. Stick with older versions on checkstyle. This may be a bug with the checkstyle plugin and not the multiproject plugin, suggest that once the culprit is identified the bug report be moved to the appropriate plugin for fixing. Rupert
          Hide
          Guillaume Dufloux added a comment -

          Hi,

          Faced with that problem, i advise using maven-checkstyle-plugin v3.0 if new features are not required for you. (release notes can be caught here : http://maven.apache.org/maven-1.x/plugins/checkstyle/downloads.html). However, v3.0.1 might be modified in order to comment an if-block (see (2) below)

          Futhermore, exclude property can be set in each child project of multiproject.
          For instance, in dummy/project.properties, you can add :
          maven.multiproject.excludes=dummy/project.xml

          Then there's no error.
          Hope that helps,

          Guillaume

          (1) in stacktrace, error commes from :
          maven-multiproject-plugin-1.4.1/plugin.jelly : l.145
          ----------------------------------------------------
          <j:if test="$

          {reactorProject.id == pom.id}

          ">
          <fail message="You must exclude $

          {pom.id}

          (the top level project) from the subproject set"/>
          </j:if>

          (2) part of a patch from 3.0 :
          maven-checkstyle-plugin-3.0.1/plugin.jelly : l.273
          --------------------------------------------------
          <j:if test="$

          {navType == 'aggregate'}

          ">
          <maven:get plugin="maven-multiproject-plugin" property="maven.multiproject.aggregateDir" var="aggregateDir" />
          <j:set var="baseurl" value="$

          {pom.url}

          /$

          {aggregateDir}

          /$

          {pom.artifactId}

          "/>
          </j:if>

          Show
          Guillaume Dufloux added a comment - Hi, Faced with that problem, i advise using maven-checkstyle-plugin v3.0 if new features are not required for you. (release notes can be caught here : http://maven.apache.org/maven-1.x/plugins/checkstyle/downloads.html ). However, v3.0.1 might be modified in order to comment an if-block (see (2) below) Futhermore, exclude property can be set in each child project of multiproject. For instance, in dummy/project.properties, you can add : maven.multiproject.excludes=dummy/project.xml Then there's no error. Hope that helps, Guillaume (1) in stacktrace, error commes from : maven-multiproject-plugin-1.4.1/plugin.jelly : l.145 ---------------------------------------------------- <j:if test="$ {reactorProject.id == pom.id} "> <fail message="You must exclude $ {pom.id} (the top level project) from the subproject set"/> </j:if> (2) part of a patch from 3.0 : maven-checkstyle-plugin-3.0.1/plugin.jelly : l.273 -------------------------------------------------- <j:if test="$ {navType == 'aggregate'} "> <maven:get plugin="maven-multiproject-plugin" property="maven.multiproject.aggregateDir" var="aggregateDir" /> <j:set var="baseurl" value="$ {pom.url} /$ {aggregateDir} /$ {pom.artifactId} "/> </j:if>
          Hide
          Michael Osipov added a comment -

          Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

          Show
          Michael Osipov added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

            People

            • Assignee:
              Unassigned
              Reporter:
              Rupert Smith
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: