Java 这个Maven插件真的有一个无效的描述符吗?

Java 这个Maven插件真的有一个无效的描述符吗?,java,maven-2,Java,Maven 2,命令: mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.beardedgeeks -DarchetypeArtifactId =gae-eclipse-maven-archetype -DarchetypeVersion=1.1.2 -DarchetypeRepository=http://beardedgeeks.googlecode.com/svn

命令:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.beardedgeeks -DarchetypeArtifactId
=gae-eclipse-maven-archetype  -DarchetypeVersion=1.1.2 -DarchetypeRepository=http://beardedgeeks.googlecode.com/svn/repository/release
s
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager getting plugin 'org.apache.maven.plugins:maven-archetype-plugin': Plugin 'org.apache.maven
.plugins:maven-archetype-plugin:2.0-alpha-4' has an invalid descriptor:
1) Plugin's descriptor contains the wrong group ID: net.kindleit
2) Plugin's descriptor contains the wrong artifact ID: maven-gae-plugin
3) Plugin's descriptor contains the wrong version: 0.5.9
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Jun 09 20:48:35 CEST 2010
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
输出:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.beardedgeeks -DarchetypeArtifactId
=gae-eclipse-maven-archetype  -DarchetypeVersion=1.1.2 -DarchetypeRepository=http://beardedgeeks.googlecode.com/svn/repository/release
s
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager getting plugin 'org.apache.maven.plugins:maven-archetype-plugin': Plugin 'org.apache.maven
.plugins:maven-archetype-plugin:2.0-alpha-4' has an invalid descriptor:
1) Plugin's descriptor contains the wrong group ID: net.kindleit
2) Plugin's descriptor contains the wrong artifact ID: maven-gae-plugin
3) Plugin's descriptor contains the wrong version: 0.5.9
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Jun 09 20:48:35 CEST 2010
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
[INFO]正在扫描项目。。。
[信息]------------------------------------------------------------------------
[错误]生成错误
[信息]------------------------------------------------------------------------
[信息]插件管理器获取插件“org.apache.maven”时出现内部错误。插件:maven原型插件:插件“org.apache.maven”
.plugins:maven原型plugin:2.0-alpha-4'的描述符无效:
1) 插件的描述符包含错误的组ID:net.kindleit
2) 插件的描述符包含错误的工件ID:maven gae Plugin
3) 插件的描述符包含错误的版本:0.5.9
[信息]------------------------------------------------------------------------
[信息]有关更多信息,请使用-e开关运行Maven
[信息]------------------------------------------------------------------------
[信息]总时间:<1秒
[信息]完成时间:2010年6月9日星期三20:48:35
[信息]最终内存:3M/15M
[信息]------------------------------------------------------------------------

我很难相信这个Maven插件有一个无效的描述符,因为其他人似乎在毫无问题地使用它。我做错了什么吗?

无法重现您的问题,以下命令对我来说很好(复制并粘贴自):

使用Maven 2.2.1进行测试:

$ mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_20
Java home: /usr/lib/jvm/java-6-sun-1.6.0.20/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-22-generic" arch: "i386" Family: "unix"

我经常遇到本地存储库中糟糕的元数据问题。这种错误通常在我做了之后就消失了

rm -Rf my/home/dir/.m2/repository/net/kendleit/maven-gae-plugin
但实际上,它与Pascal一起工作的原因是Pascal使用了这个url
http://beardedgeeks.googlecode.com/svn/repository/releases
而您使用此url
http://beardedgeeks.googlecode.com/svn/repository/release
(缺少s,因此有404)

按照上面提到的方法执行rm,然后使用正确的url再次运行


编辑:很抱歉,我没有看到一个尾随s。我收回了所有内容,但仍然:尝试删除本地repo中的元数据

原因: Nexus中的GAV(groupid、artifactid、version)(因此在本地存储库和pom.xml中)与\META-INF\maven\plugin.xml中的jar文件中的GAV不同

这通常发生在您在自己的Nexus(或任何其他maven企业存储库)中手动上载插件工件时

解决方案:

  • 下载jar,看看plugin.xml中的GAV值是什么
  • 在Nexus上上传jar,将plugin.xml中的信息作为GAV传递
  • 相应地更新pom.xml

确保从Nexus中删除旧的不一致工件

谢谢!下一步我将尝试Linux。+1错误的元数据很可能是根本原因(虽然我已经有一段时间没有遇到错误的元数据了)。那么您的nexus可能比我被迫使用的nexus要好:-)