You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Van Steenberghe Mario (GFDI)" <Ma...@gfdi.be> on 2005/08/17 14:47:50 UTC
[m2] how to create a new lifecycle mapping ?
Hello,
I'm trying to create a new lifecyle mapping in maven2. For this I create
a file named components.xml inside src/main/resources/META-INF/plexus as
follows:
<components>
<component>
<role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
<role-hint>rcpApplication</role-hint>
<implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMappi
ng</implementation>
<configuration>
<phases>
<package>eclipsebuilder:rcpApplication</package>
<install>eclipsebuilder:installRcpApplication</install>
<deploy>eclipsebuilder:deployRcpApplication</deploy>
</phases>
</configuration>
</component>
</components>
In my POM I refer to this lifecycle as follows:
<project>
<parent>
<groupId>jade2</groupId>
<artifactId>main</artifactId>
<version>HEAD</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>jade2</groupId>
<artifactId>application</artifactId>
<version>HEAD</version>
<packaging>rcpApplication</packaging>
</project>
Apparantly, maven2 doesn't seem to know where to find this lifecycle.
When I run m2 -e deploy, I get the following exception:
[ERROR] Nonexistent component:
org.apache.maven.lifecycle.mapping.LifecycleMappingrcpApplication
FATAL ERROR: Error executing Maven for a project
Error stacktrace:
org.apache.maven.reactor.ReactorException: Error executing project
within the reactor
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:241)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:79)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
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.apache.maven.lifecycle.LifecycleExecutionException:
Cannot find lifecycle mapping for packaging: 'rcpApplication'.
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.findMappingsForLifec
ycle(DefaultLifecycleExecutor.java:618)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindLifecycleForPack
aging(DefaultLifecycleExecutor.java:555)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycleMa
ppings(DefaultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
ifecycleExecutor.java:430)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:268)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
ycleExecutor.java:127)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186)
... 9 more
Caused by:
org.codehaus.plexus.component.repository.exception.ComponentLookupExcept
ion: Component descriptor cannot be found in the component repository:
org.apache.ma
ven.lifecycle.mapping.LifecycleMappingrcpApplication.
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer
.java:299)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer
.java:416)
at
org.apache.maven.execution.MavenSession.lookup(MavenSession.java:98)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.findMappingsForLifec
ycle(DefaultLifecycleExecutor.java:614)
... 15 more
Is there anyone out there experiencing the same problems, or perhaps
knows how the maven2 lifecycle binding works ?
Thanks,
Mario.
Re: [m2] how to create a new lifecycle mapping ?
Posted by Brett Porter <br...@gmail.com>.
The lifecycle doco may have been misleading - the components file you
have must be in a plugin that has the goals you've created.
You must then declare this plugin in your project with the
<extensions>true</extensions> flag (this is new as of beta-1-SNAPSHOT,
previously it did not work).
Hope this helps.
Cheers
Brett
On 8/17/05, Van Steenberghe Mario (GFDI) <Ma...@gfdi.be> wrote:
> Hello,
>
>
>
> I'm trying to create a new lifecyle mapping in maven2. For this I create
> a file named components.xml inside src/main/resources/META-INF/plexus as
> follows:
>
>
>
> <components>
>
> <component>
>
> <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
>
> <role-hint>rcpApplication</role-hint>
>
>
> <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMappi
> ng</implementation>
>
> <configuration>
>
> <phases>
>
> <package>eclipsebuilder:rcpApplication</package>
>
> <install>eclipsebuilder:installRcpApplication</install>
>
> <deploy>eclipsebuilder:deployRcpApplication</deploy>
>
> </phases>
>
> </configuration>
>
> </component>
>
> </components>
>
>
>
> In my POM I refer to this lifecycle as follows:
>
>
>
> <project>
>
>
>
> <parent>
>
> <groupId>jade2</groupId>
>
> <artifactId>main</artifactId>
>
> <version>HEAD</version>
>
> </parent>
>
>
>
> <modelVersion>4.0.0</modelVersion>
>
> <groupId>jade2</groupId>
>
> <artifactId>application</artifactId>
>
> <version>HEAD</version>
>
> <packaging>rcpApplication</packaging>
>
>
>
> </project>
>
>
>
> Apparantly, maven2 doesn't seem to know where to find this lifecycle.
> When I run m2 -e deploy, I get the following exception:
>
>
>
> [ERROR] Nonexistent component:
> org.apache.maven.lifecycle.mapping.LifecycleMappingrcpApplication
>
> FATAL ERROR: Error executing Maven for a project
>
> Error stacktrace:
>
> org.apache.maven.reactor.ReactorException: Error executing project
> within the reactor
>
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:241)
>
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:292)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:79)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:41)
>
> at java.lang.reflect.Method.invoke(Method.java:386)
>
> 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.apache.maven.lifecycle.LifecycleExecutionException:
> Cannot find lifecycle mapping for packaging: 'rcpApplication'.
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.findMappingsForLifec
> ycle(DefaultLifecycleExecutor.java:618)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindLifecycleForPack
> aging(DefaultLifecycleExecutor.java:555)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycleMa
> ppings(DefaultLifecycleExecutor.java:539)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
> ifecycleExecutor.java:430)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
> DefaultLifecycleExecutor.java:268)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
> ycleExecutor.java:127)
>
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186)
>
> ... 9 more
>
> Caused by:
> org.codehaus.plexus.component.repository.exception.ComponentLookupExcept
> ion: Component descriptor cannot be found in the component repository:
> org.apache.ma
>
> ven.lifecycle.mapping.LifecycleMappingrcpApplication.
>
> at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer
> .java:299)
>
> at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer
> .java:416)
>
> at
> org.apache.maven.execution.MavenSession.lookup(MavenSession.java:98)
>
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.findMappingsForLifec
> ycle(DefaultLifecycleExecutor.java:614)
>
> ... 15 more
>
>
>
>
>
> Is there anyone out there experiencing the same problems, or perhaps
> knows how the maven2 lifecycle binding works ?
>
>
>
> Thanks,
>
> Mario.
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org