[mule-user] mvn archetype:generate + mule-project-archetype

52 views
Skip to first unread message

jeroenv

unread,
Jun 18, 2008, 3:53:27 PM6/18/08
to us...@mule.codehaus.org

Hi,

I am trying out the m2eclipse plugin. This plugin has the nice feature that
you can start a project based on an archetype, which in my opinion is
fantastic: not every open source project needs to write an eclipse plugin to
do this, they only need an archetype.

Anyway, I cannot get it to work. i found out that in background something
like the following is executed:

mvn archetype:generate -DarchetypeGroupId=org.mule.tools
-DarchetypeArtifactId=mule-project-archetype -DarchetypeVersion=2.0.1

This gives me the error below. Apparently this is because
'archetype-resources/pom.xml' is missing. Indeed I can only find a velocity
template (pom.vm).

Does this mean I can never use the mule project archetype with m2eclipse?

cheers,
jeroen

[INFO]
----------------------------------------------------------------------------
[INFO] Using following parameters for creating OldArchetype:
mule-project-archetype:2.0.1
[INFO]
----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: test
[INFO] Parameter: packageName, Value: test
[INFO] Parameter: package, Value: test
[INFO] Parameter: artifactId, Value: test
[INFO] Parameter: basedir, Value: C:\mydata\workspace_mule
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[ERROR] ResourceManager : unable to find resource
'archetype-resources/pom.xml' in any resource loader.
[ERROR] Failed to generate project from the old archetype
org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Failed to
generate project from the old archetype
at
org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processOldArchetype(DefaultArchetypeGenerator.java:272)
at
org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:145)
at
org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:290)
at
org.apache.maven.archetype.DefaultArchetype.generateProjectFromArchetype(DefaultArchetype.java:75)
at
org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:185)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:224)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
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)
Caused by:
org.apache.maven.archetype.old.ArchetypeTemplateProcessingException: Error
merging velocity templates
at
org.apache.maven.archetype.old.DefaultOldArchetype.processTemplate(DefaultOldArchetype.java:911)
at
org.apache.maven.archetype.old.DefaultOldArchetype.processTemplate(DefaultOldArchetype.java:748)
at
org.apache.maven.archetype.old.DefaultOldArchetype.processTemplates(DefaultOldArchetype.java:489)
at
org.apache.maven.archetype.old.DefaultOldArchetype.createArchetype(DefaultOldArchetype.java:337)
at
org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processOldArchetype(DefaultArchetypeGenerator.java:255)
... 22 more
Caused by: org.apache.velocity.exception.ResourceNotFoundException: Unable
to find resource 'archetype-resources/pom.xml'
at
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:452)
at
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
at
org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
at
org.apache.maven.archetype.old.DefaultOldArchetype.processTemplate(DefaultOldArchetype.java:905)
... 26 more
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] : org.apache.maven.archetype.exception.ArchetypeGenerationFailure:
Failed to generate project from the old archetype
Failed to generate project from the old archetype
--
View this message in context: http://www.nabble.com/mvn-archetype%3Agenerate-%2B-mule-project-archetype-tp17990452p17990452.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Marcio Miranda

unread,
Jun 18, 2008, 7:46:32 PM6/18/08
to us...@mule.codehaus.org
I've also tried to create a new project from an archetype in Eclipse and got
the following output in the console:

==================================================================
6/18/08 11:06:34 AM BRT: [INFO] User settings file does not exist
C:\Documents and Settings\Fast\.m2\settings.xml
6/18/08 11:06:41 AM BRT: [INFO] User settings file does not exist
C:\Documents and Settings\Fast\.m2\settings.xml
6/18/08 11:06:50 AM BRT: Downloading central :
nexus-maven-repository-index.properties
6/18/08 11:06:50 AM BRT: Downloaded [central] ->
http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.properties
6/18/08 11:06:50 AM BRT: No index update available for central
6/18/08 7:23:31 PM BRT: [INFO] Setting property:
classpath.resource.loader.class =>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
6/18/08 7:23:31 PM BRT: [INFO] Setting property: velocimacro.messages.on =>
'false'.
6/18/08 7:23:31 PM BRT: [INFO] Setting property: resource.loader =>
'classpath'.
6/18/08 7:23:31 PM BRT: [INFO] Setting property:
resource.manager.logwhenfound => 'false'.
6/18/08 7:23:36 PM BRT: [INFO]
----------------------------------------------------------------------------
6/18/08 7:23:36 PM BRT: [INFO] Using following parameters for creating
OldArchetype: mule-project-archetype:2.0.1
6/18/08 7:23:36 PM BRT: [INFO]
----------------------------------------------------------------------------
6/18/08 7:23:36 PM BRT: [INFO] Parameter: groupId, Value: com.druid
6/18/08 7:23:36 PM BRT: [INFO] Parameter: packageName, Value: com.druid.odin
6/18/08 7:23:36 PM BRT: [INFO] Parameter: basedir, Value: C:/Projects
6/18/08 7:23:36 PM BRT: [INFO] Parameter: package, Value: com.druid.odin
6/18/08 7:23:36 PM BRT: [INFO] Parameter: version, Value: 0.0.1-SNAPSHOT
6/18/08 7:23:36 PM BRT: [INFO] Parameter: artifactId, Value: odin
6/18/08 7:23:36 PM BRT: [ERROR] Failed to generate project from the old
archetype Failed to generate project from the old archetype
==================================================================

Regards,
Marcio.

Dirk Olmes

unread,
Jun 19, 2008, 3:10:08 AM6/19/08
to us...@mule.codehaus.org
jeroenv wrote:
> Hi,
>
> I am trying out the m2eclipse plugin. This plugin has the nice feature that
> you can start a project based on an archetype, which in my opinion is
> fantastic: not every open source project needs to write an eclipse plugin to
> do this, they only need an archetype.
>
> Anyway, I cannot get it to work. i found out that in background something
> like the following is executed:
>
> mvn archetype:generate -DarchetypeGroupId=org.mule.tools
> -DarchetypeArtifactId=mule-project-archetype -DarchetypeVersion=2.0.1
>
> This gives me the error below. Apparently this is because
> 'archetype-resources/pom.xml' is missing. Indeed I can only find a velocity
> template (pom.vm).

Have a look at
http://mule.mulesource.org/display/MULE2USER/Project+Archetype which
describes how to use the project archetype.

Note especially which archetype goal we use (create) vs the one that you
found out (generate).

We create and compile a sample project as part of our daily build so I'm
pretty sure that the archetype works per se. Cannot comment on m2eclipse
though ...

HTH,

-dirk

jeroenv

unread,
Jun 19, 2008, 5:40:50 AM6/19/08
to us...@mule.codehaus.org
Dirk Olmes-5 wrote:
Have a look at http://mule.mulesource.org/display/MULE2USER/Project+Archetype which describes how to use the project archetype. Note especially which archetype goal we use (create) vs the one that you found out (generate).
I have used the archetype like this and it works very good. I would however like to get it working under m2eclipse and this one uses the generate goal. Note by the way that the create goal is being deprecated for archetypes: http://maven.apache.org/plugins/maven-archetype-plugin/plugin-info.html kind regards, jeroen

View this message in context: Re: mvn archetype:generate + mule-project-archetype
Reply all
Reply to author
Forward
0 new messages