Maven
  1. Maven
  2. MNG-2831

Cannot add custom artifact handler and custom lifecycle as a build extension

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.5
    • Fix Version/s: 2.0.7
    • Component/s: General
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      I have an extension registering a custom artifact handler and a custom lifecycle against plexus. The project that uses that extension get the following error:

      [DEBUG] Error looking up lifecycle mapping to retrieve optional mojos. Lifecycle ID: clean. Error: Component descriptor cannot be found in the component repository: org.apache.maven.lifecycle.mapping.LifecycleMappingxar.
      org.codehaus.plexus.component.repository.exception.ComponentLookupException: Component descriptor cannot be found in the component repository: org.apache.maven.lifecycle.mapping.LifecycleMappingxar.
              at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:323)
              at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
              at org.apache.maven.execution.MavenSession.lookup(MavenSession.java:123)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findOptionalMojosForLifecycle(DefaultLifecycleExecutor.java:1111)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindLifecycleForPackaging(DefaultLifecycleExecutor.java:999)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycleMappings(DefaultLifecycleExecutor.java:980)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
              at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
              at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
              at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      [DEBUG] Skipping disabled repository codehaus.plugin.snapshots
      [DEBUG] Skipping disabled repository apache.snapshots
      [DEBUG] maven-clean-plugin: resolved to version 2.1 from repository central
      [DEBUG] Retrieving parent-POM: org.apache.maven.plugins:maven-plugin-parent::2.0 for project: null:maven-clean-plugin:maven-plugin:2.1 from the repository.
      [DEBUG] org.apache.maven.plugins:maven-clean-plugin:maven-plugin:2.1:runtime (selected for runtime)
      [DEBUG]   org.apache.maven:maven-plugin-api:jar:2.0:runtime (selected for runtime)
      [DEBUG] Retrieving parent-POM: org.apache.maven.shared:shared-components-parent::1 for project: null:file-management:jar:1.0 from the repository.
      [DEBUG]   org.apache.maven.shared:file-management:jar:1.0:runtime (selected for runtime)
      [DEBUG]     org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime (selected for runtime)
      [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-clean-plugin:2.1:clean' -->
      [DEBUG]   (f) directory = /Users/vmassol/dev/maven/trunks/core-integration-testing/core-integration-tests/src/test/resources/it0115-customArtifactHandlerAndCustomLifecycle/test-project/target
      [DEBUG]   (f) outputDirectory = /Users/vmassol/dev/maven/trunks/core-integration-testing/core-integration-tests/src/test/resources/it0115-customArtifactHandlerAndCustomLifecycle/test-project/target/classes
      [DEBUG]   (f) testOutputDirectory = /Users/vmassol/dev/maven/trunks/core-integration-testing/core-integration-tests/src/test/resources/it0115-customArtifactHandlerAndCustomLifecycle/test-project/target/test-classes
      [DEBUG] -- end configuration --
      [INFO] [clean:clean]
      [INFO] Deleting directory /Users/vmassol/dev/maven/trunks/core-integration-testing/core-integration-tests/src/test/resources/it0115-customArtifactHandlerAndCustomLifecycle/test-project/target
      [DEBUG] Found deletable paths: []
      [INFO] Deleting directory /Users/vmassol/dev/maven/trunks/core-integration-testing/core-integration-tests/src/test/resources/it0115-customArtifactHandlerAndCustomLifecycle/test-project/target/classes
      [DEBUG] Found deletable paths: []
      [INFO] Deleting directory /Users/vmassol/dev/maven/trunks/core-integration-testing/core-integration-tests/src/test/resources/it0115-customArtifactHandlerAndCustomLifecycle/test-project/target/test-classes
      [DEBUG] Found deletable paths: []
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Cannot find lifecycle mapping for packaging: 'xar'.
      Component descriptor cannot be found in the component repository: org.apache.maven.lifecycle.mapping.LifecycleMappingxar.
      [INFO] ------------------------------------------------------------------------
      [DEBUG] Trace
      org.apache.maven.lifecycle.LifecycleExecutionException: Cannot find lifecycle mapping for packaging: 'xar'.
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findMappingsForLifecycle(DefaultLifecycleExecutor.java:1071)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindLifecycleForPackaging(DefaultLifecycleExecutor.java:997)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycleMappings(DefaultLifecycleExecutor.java:980)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
              at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
              at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
              at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Component descriptor cannot be found in the component repository: org.apache.maven.lifecycle.mapping.LifecycleMappingxar.
              at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:323)
              at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
              at org.apache.maven.execution.MavenSession.lookup(MavenSession.java:123)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findMappingsForLifecycle(DefaultLifecycleExecutor.java:1064)
              ... 17 more
      

      I have created an it0115 test in /trunks/core-integration-testing/core-integration-tests/src/test/resources/it0115-customArtifactHandlerAndCustomLifecycle to reproduce the problem.

        Issue Links

          Activity

          Hide
          Jason van Zyl added a comment -

          This does not work currently on the branch. I'm not sure anyone other then Vincent is using this as it is a custom packaging along with an artifact handler. I'm not sure this is critical for 2.0.7.

          Show
          Jason van Zyl added a comment - This does not work currently on the branch. I'm not sure anyone other then Vincent is using this as it is a custom packaging along with an artifact handler. I'm not sure this is critical for 2.0.7.
          Hide
          Brett Porter added a comment -

          I'd say it's a priority for 2.0.x only if it's a regression against an earlier 2.0.x, and there is no workaround.

          I guess this could be closed for 2.1-alpha-1, and if we do fix it for 2.0.7 change the version?

          Show
          Brett Porter added a comment - I'd say it's a priority for 2.0.x only if it's a regression against an earlier 2.0.x, and there is no workaround. I guess this could be closed for 2.1-alpha-1, and if we do fix it for 2.0.7 change the version?
          Hide
          Vincent Massol added a comment -

          FYI it is a regression from earlier. It used to work in 2.0.4 or 2.0.5.

          Show
          Vincent Massol added a comment - FYI it is a regression from earlier. It used to work in 2.0.4 or 2.0.5.
          Hide
          Jason van Zyl added a comment -

          Then it's somethign that we'll need to fix for 2.0.7. I'm sure this is a result of changing how the extension manager worked. The fix version is 2.0.7.

          Show
          Jason van Zyl added a comment - Then it's somethign that we'll need to fix for 2.0.7. I'm sure this is a result of changing how the extension manager worked. The fix version is 2.0.7.
          Hide
          Jason van Zyl added a comment -

          Just running the ITs against a fix to make sure everything is ok, and then I think this one is licked.

          Show
          Jason van Zyl added a comment - Just running the ITs against a fix to make sure everything is ok, and then I think this one is licked.

            People

            • Assignee:
              Jason van Zyl
              Reporter:
              Vincent Massol
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: