Maven
  1. Maven
  2. MNG-3506

Custom ArtifactHandler not resolved for project when an additional plugin with extensions is defined in parent pom

    Details

      Description

      Hi,

      I've found an annoying bug regarding custom artifact handlers. A custom artifact handler provided by a plugin with extensions is not resolved when another plugin with extensions is defined in parent pom. Note that the behavior is the same whether the first plugin is defined in child project or parent project.

      In order to illustrate the problem, I've used the maven-eclipse-plugin. It generates a .classpath only when the project's artifact handler's language is set to java. My child project's packaging is "jboss-sar" whose artifact handler is provided by jboss-packaging-maven-plugin. "jboss-sar" 's language is set to java, so whenever the jboss'sar artifact handler is properly resolved, the .classpath file should be generated.

      I've used the nbm-maven-plugin as the second perturbing plugin in order to break the resolution.

      I've attached a set of it tests which each illustrate a working or broken scenario. In order to test those, simply run the following command at the root of each parent project:
      mvn clean eclipse:clean install eclipse:eclipse

      If the file .classpath is properly generated in "module1" child project, then the test passes, else it fails. Attached it tests contain "OK" when they pass and "KO" when then fails.

      I've tried hard to debug plexus component resolution internals but after a whole day of headackes I gave up and ended up posting this issue hoping that somebody more used to maven and plexus internals would find a solution.

      Kind regards,

      Cédric Vidal
      http://proxiad.com

        Issue Links

          Activity

          Cédric Vidal created issue -
          c.vidal made changes -
          Field Original Value New Value
          Attachment sample-01-OK-main-plugin-in-child-pom.zip [ 33683 ]
          c.vidal made changes -
          Attachment sample-02-OK-main-plugin-with-additional-plugin-in-child-pom.zip [ 33684 ]
          c.vidal made changes -
          Attachment sample-03-OK-main-plugin-in-parent-pom.zip [ 33685 ]
          c.vidal made changes -
          Attachment sample-04-KO-main-plugin-with-additional-plugin-in-parent-pom.zip [ 33686 ]
          c.vidal made changes -
          Attachment sample-05-KO-main-plugin-in-child-pom-with-additional-plugin-in-parent-pom.zip [ 33687 ]
          Brett Porter made changes -
          Fix Version/s 2.0.x [ 13141 ]
          Hide
          John Casey added a comment -

          we may need to change the name of the next version from '2.2.1' but I'd really like to have this on the list.

          Show
          John Casey added a comment - we may need to change the name of the next version from '2.2.1' but I'd really like to have this on the list.
          John Casey made changes -
          Fix Version/s 2.2.1 [ 15328 ]
          Fix Version/s 2.2.x [ 13141 ]
          John Casey made changes -
          Assignee John Casey [ jdcasey ]
          Hide
          John Casey added a comment -

          This is fixed in 2.2.1-SNAPSHOT, just needs an integration test. I'll probably be able to hack that out by tomorrow...

          Show
          John Casey added a comment - This is fixed in 2.2.1-SNAPSHOT, just needs an integration test. I'll probably be able to hack that out by tomorrow...
          John Casey made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          John Casey made changes -
          Link This issue is duplicated by MNG-2426 [ MNG-2426 ]
          John Casey made changes -
          Link This issue relates to MNG-4270 [ MNG-4270 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 08:49:45 UTC 2015 [ 1428223785911 ]
          Mark Thomas made changes -
          Workflow jira [ 12713922 ] Default workflow, editable Closed status [ 12753694 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 21:45:26 UTC 2015 [ 1428270326204 ]
          Mark Thomas made changes -
          Workflow jira [ 12953203 ] Default workflow, editable Closed status [ 12989084 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          472d 2h 31m 1 John Casey 23/Jul/09 17:26

            People

            • Assignee:
              John Casey
              Reporter:
              Cédric Vidal
            • Votes:
              5 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development