Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0.7
-
Fix Version/s: Issues to be reviewed for 3.x
-
Component/s: Plugins and Lifecycle
-
Labels:None
-
Number of attachments :
Description
I've made a plugin and a test project to show a possible bug when using custom packaging and forked lifecycle (the "site" lifecycle in fact).
The plugin is called "foobar-maven-plugin". It defines the custom packaging "foobar", that is equivalent to "jar".
The projet is called "test-project". It contains two modules, "module1" and "module2" that have the "foobar" packaging. "module2" depends on "module1".
After installing the plugin, I can, for instance, compile or package the project "test-project" by lauching "mvn compile" or "mvn package".
But the command "mvn site" isn't working (module2 can't find module1). In debug mode, we can in maven logs :
[INFO] ----------------------------------------------------------------------------
[INFO] Building Unnamed - com.example.test:module1:foobar:1.0
[INFO] task-segment: [site]
[INFO] ----------------------------------------------------------------------------
[DEBUG] Error looking up lifecycle mapping to retrieve optional mojos. Lifecycle ID: site. Error: Component descriptor cannot be found in the component repository: org.apache.maven.lifecycle.mapping.LifecycleMappingfoobar.
org.codehaus.plexus.component.repository.exception.ComponentLookupException: Component descriptor cannot be found in the component repository: org.apache.maven.lifecycle.mapping.LifecycleMappingfoobar.
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:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
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:597)
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)