I’m trying to go through the examples in Maven: The Definitive Guide. In chapter ‘4.3. Creating the Simple Weather Project’ it has me run the following command.
mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch04 -DartifactId=simple-weather -DpackageName=org.sonatype.mavenbook -Dversion=1.0
I think these errors are a problem.
[WARNING] POM for 'asm:asm-commons:pom:3.2:runtime' is invalid. It will be ignored for artifact resolution. Reason: Failed to validate POM for project asm:asm-commons at Artifact [asm:asm-commons:pom:3.2:runtime]
[WARNING] POM for 'asm:asm-util:pom:3.2:runtime' is invalid. It will be ignored for artifact resolution. Reason: Failed to validate POM for project asm:asm-util at Artifact [asm:asm-util:pom:3.2:runtime]
[WARNING] POM for 'asm:asm-analysis:pom:3.2:runtime' is invalid. It will be ignored for artifact resolution. Reason: Failed to validate POM for project asm:asm-analysis at Artifact [asm:asm-analysis:pom:3.2:runtime]
[WARNING] POM for 'asm:asm-tree:pom:3.2:runtime' is invalid. It will be ignored for artifact resolution. Reason: Failed to validate POM for project asm:asm-tree at Artifact [asm:asm-tree:pom:3.2:runtime]
because later I on get the message this
[INFO] Failed to resolve artifact.
Missing
--------
org.apache.maven.archetype:archetype-catalog:jar:1.0
org.apache.maven.archetype:archetype-common:jar:1.0
org.apache.maven.archetype:archetype-registry:jar:1.0
org.apache.maven.archetype:archetype-descriptor:jar:1.0
I ran the command again with debug on and I’ve included the output in a pastebin link
mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch04 -DartifactId=simple-weather -DpackageName=org.sonatype.mavenbook -Dversion=1.0 --debug > mvnoutput.txt
http://pastebin.me/e50a3e5fa84cd8e8ff9336b3c3062d7f
I really have no idea why this is failing. I tried to navigate to the POMs manually using the
http://search.maven.org/remotecontent?filepath=asm/asm-commons/3.2/asm-commons-3.2.pom along with the other POMs and they look fine to me (but I’m trying to learn Maven.)
Here is my mvn effective settings. I left out the schema stuff at the very beginning. I am behind a proxy, but everything else seems to download fine. Any help would be much appreciated. I’ll answer questions or post more information if you leave them as comments.
<localRepository>C:\Documents and Settings\~removed~\.m2\repository</localRepository>
<proxies>
<proxy>
<active>true</active>
<username>~removed~</username>
<password>~removed~</password>
<host>~removed~</host>
<nonProxyHosts>~removed~</nonProxyHosts>
<id>optional</id>
</proxy>
The most important thing is to start with Maven 3.0.4 instead of Maven 2.0.8. Furthermore you need to use:
instead of
Take a look into the docs of the archetype plugin.
And one thing i recognized is that you are using an old book: Take a look into “Maven by Example” book and “Maven: The Complete Reference”.