我正在尝试浏览 Maven: The Definitive Guide 中的示例。在'4.3. 创建简单天气项目'它让我运行以下命令。
mvn archetype:create -DgroupId=org.sonatype.mavenbook.ch04 -DartifactId=simple-weather -DpackageName=org.sonatype.mavenbook -Dversion=1.0
我认为这些错误是一个问题。
[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]
因为后来我收到了这个消息
[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
我再次打开调试运行命令,并将输出包含在 pastebin 链接中
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
我真的不知道为什么会失败。我尝试使用手动导航到 POM
http://search.maven.org/remotecontent?filepath=asm/asm-commons/3.2/asm-commons-3.2.pom以及其他 POM 对我来说看起来不错(但我正在尝试学习 Maven。 )
这是我的 mvn 有效设置。我在一开始就省略了模式的东西。我在代理后面,但其他一切似乎都可以下载。任何帮助将非常感激。如果您将问题留作评论,我会回答问题或发布更多信息。
<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>