Do your archetypes refer to repositories that you defined?
On 19-Aug-08, at 8:36 PM, Jason Dillon wrote:
Hiya, I'm getting lots of user reports of problems using the GMaven
archetypes... could be my fault for not really understanding how the
new stuff works fully. But seems like folks that don't already have
the artifacts in their local repo (most users) can't use them. I
_thought_ that this would simply work for them:
<snip>
mvn archetype:generate -
DarchetypeGroupId=org.codehaus.groovy.maven.archetypes -
DarchetypeArtifactId=gmaven-archetype-basic -Dversion=1.0-rc-3
</snip>
I also tried setting {{-DarchetypeCatalog=remote}}, but that fails
with:
<snip>
INFO] [archetype:generate]
[INFO] Generating project in Interactive mode
[WARNING] Error reading archetype catalog http://repo1.maven.org/
maven2
org.apache.maven.wagon.ResourceDoesNotExistException: Unable to
locate resource in repository
at
org
.apache
.maven
.wagon
.providers
.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:
100)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:68)
at
org
.apache
.maven
.archetype
.source
.RemoteCatalogArchetypeDataSource
.getArchetypeCatalog(RemoteCatalogArchetypeDataSource.java:74)
at
org
.apache
.maven
.archetype.DefaultArchetype.getRemoteCatalog(DefaultArchetype.java:
203)
at
org
.apache
.maven
.archetype.DefaultArchetype.getRemoteCatalog(DefaultArchetype.java:
192)
at
org
.apache
.maven
.archetype
.ui
.DefaultArchetypeSelector
.getArchetypesByCatalog(DefaultArchetypeSelector.java:244)
at
org
.apache
.maven
.archetype
.ui
.DefaultArchetypeSelector
.selectArchetype(DefaultArchetypeSelector.java:74)
at
org
.apache
.maven
.archetype
.mojos
.CreateProjectFromArchetypeMojo
.execute(CreateProjectFromArchetypeMojo.java:180)
at
org
.apache
.maven
.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:
451)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:
558)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor
.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:
482)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor
.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor
.executeTaskSegments(DefaultLifecycleExecutor.java:227)
at
org
.apache
.maven
.lifecycle
.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
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: java.io.FileNotFoundException:
http://repo1.maven.org/maven2/archetype-catalog.xml
at
sun
.net
.www
.protocol
.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1168)
at
org
.apache
.maven
.wagon
.providers
.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:83)
... 25 more
[WARNING] Specified archetype not found.
[INFO] No archetype defined. Using maven-archetype-quickstart
(org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
</snip>
* * *
So, my question is how can a user use the new archetype plugin with
an archetype that is not in the "internal" catalog?
I have played a little with the "local" catalog, which seems to
allow the GMaven archetypes to resolve, though it ignores the
version (if I ask for a release, but I have previously built a
snapshot, I get the snapshot version).
Anyways, I could use some advise on what is the proper/supported way
to use custom archetypes. I have 2 of them right now:
http://repo1.maven.org/maven2/org/codehaus/groovy/maven/archetypes/gmaven-archetype-basic/
http://repo1.maven.org/maven2/org/codehaus/groovy/maven/archetypes/gmaven-archetype-mojo/
Thanks,
--jason
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
jason at sonatype dot com
----------------------------------------------------------
Selfish deeds are the shortest path to self destruction.
-- The Seven Samuari, Akira Kirosawa
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]