Did you ever figure out what was wrong here? I'm running into the same issue
now with the alpha-3 plugin.
Prystash,John wrote:
Hey Raphaël, I added the settings to my settings.xml as you described and
ran archetype:create-from-project. The POM file referenced 2.0-alpha-2.
$ mvn -P apache-snapshots archetype:create-from-project
$ cat target/generated-sources/archetype/pom.xml
?xml version=1.0 encoding=UTF-8?
project
...
version1.0-SNAPSHOT/version
build
extensions
extension
groupIdorg.apache.maven.archetype/groupId
artifactIdarchetype-packaging/artifactId
version2.0-alpha-2/version
/extension
/extensions
plugins
plugin
artifactIdmaven-archetype-plugin/artifactId
version2.0-alpha-2/version
extensionstrue/extensions
/plugin
/plugins
/build
/project
So I added the following to my parent POM, and the resulting POM under
target/generated-sources/archetype had 2.0-alpha-3 in them.
...
build
...
extensions
extension
groupIdorg.apache.maven.archetype/groupId
artifactIdarchetype-packaging/artifactId
version2.0-alpha-3-SNAPSHOT/version
/extension
/extensions
...
plugin
artifactIdmaven-archetype-plugin/artifactId
version2.0-alpha-3-SNAPSHOT/version
extensionstrue/extensions
/plugin
...
/build
...
Unfortunately, I now get the following error when rerunning
archetype:create-from-project:
...
[INFO] Setting property: classpath.resource.loader.class =
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on = 'false'.
[INFO] Setting property: resource.loader = 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound = 'false'.
[INFO]
[ERROR] FATAL ERROR
[INFO]
[INFO] org/apache/commons/lang/StringUtils
[INFO]
[INFO] Trace
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
at
org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:165)
at
org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:594)
at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:241)
at
org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:116)
at
org.codehaus.plexus.velocity.DefaultVelocityComponent.initialize(DefaultVelocityComponent.java:79)
...
I tried including commons-lang in POMs to see if that would help, but no
luck.
Thanks
-Original Message-
From: Raphaël Piéroni [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2008 3:40 PM
To: Maven Users List
Subject: Re: Multi-module archetypes
Hi John,
This feature is provided by the 2.0-alpha-3 version of the Archetype
plugin. This version is not yet released.
But you can try the last snapshot by adding a repository to apache
snapshot [1].
1. The goal to call from the project directory (or parent in case of a
multi module) is 'mvn archetype:create-from-project'.
2. Then go to the target/generated-sources/archetype directory and see if
the generated archetype is correct.
install the archetype in your local repository by calling 'mvn install' as
usual.
3. Then go to a fresh directory and call 'mvn archetype:generate
-DarchetypeCatalog=local'.
Step 3 may don't work because repositories defined in profiles in the
settings.xml file are recognised only when maven is called in a project's
directory. One may try to use the apache's snapshot repository as mirror
of central (not tested).
Another workaround i see is compiling the plugin from the sources.
Please share your experience of using the plugin afterward.
Thanks,
Raphaël
[1]: in settings.xml :
profile
idapache-snapshots/id
repositories
repository
idapache-snapshot/id
nameApache Snapshots/name
releases
enabledfalse/enabled
updatePolicynever/updatePolicy
checksumPolicywarn/checksumPolicy
/releases
snapshots
updatePolicyalways/updatePolicy
checksumPolicywarn/checksumPolicy
/snapshots
urlhttp://people.apache.org/maven-snapshot-repository//url
layoutdefault/layout
/repository
/repositories
pluginRepositories
pluginRepository
idapache-snapshot/id