Maven 2 mvn原型:生成生成失败

Maven 2 mvn原型:生成生成失败,maven-2,maven-archetype,Maven 2,Maven Archetype,我正在学习教程: 这里说,运行命令 mvn archetype:generate -DarchetypeCatalog=http://download.java.net/maven/2 然后给出groupId、ArtifactId等。我运行了上面的命令。但在要求groupId之前,它要求: 选择数字或应用筛选器(格式:[groupId:]artifactId,区分大小写): 由于本教程中没有给出这个数字,因此我在命令行中查看了给定的选项并选择了3。之后,它要求提供groupId和其他。我给出了

我正在学习教程: 这里说,运行命令

mvn archetype:generate -DarchetypeCatalog=http://download.java.net/maven/2
然后给出groupId、ArtifactId等。我运行了上面的命令。但在要求groupId之前,它要求:

选择数字或应用筛选器(格式:[groupId:]artifactId,区分大小写):

由于本教程中没有给出这个数字,因此我在命令行中查看了给定的选项并选择了3。之后,它要求提供groupId和其他。我给出了所有选项,然后按enter键。但是我得到了一个构建失败,说读取POM时出错

以下是输出:

Choose archetype:
1: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-    
grizzly (Archetype for creating a RESTful web application with Jersey and Grizzly)
2: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-grizzly2 (Archetype for creating a RESTful web application with Jersey and Grizzly 2.x)
3: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-webapp (Archetype for creating a Jersey based RESTful web application with WAR packaging)
4: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-ejb (Archetype for creating a Jersey based RESTful EJB application with WAR packaging)
5: http://download.java.net/maven/2 -> com.sun.faces:simple-jsf (Archetype for creating a simple JSF project)
6: http://download.java.net/maven/2 -> com.sun.faces.regression:i_jsf_XXXX-archetype (Archetype for mojarra JSF regression tests)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 3
Define value for property 'groupId': : com.persistent
Define value for property 'artifactId': : jerseySpringJPA
Define value for property 'version':  1.0-SNAPSHOT: : <CR>
Define value for property 'package':  com.persistent: : com.persistent.rest
Confirm properties configuration:
groupId: com.persistent
artifactId: jerseySpringJPA
version: <CR>
package: com.persistent.rest
 Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: jersey-quickstart-webapp:1.8
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.persistent
[INFO] Parameter: packageName, Value: com.persistent.rest
[INFO] Parameter: package, Value: com.persistent.rest
[INFO] Parameter: artifactId, Value: jerseySpringJPA
[INFO] Parameter: basedir, Value: /mwallet
[INFO] Parameter: version, Value: <CR>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:32.278s
[INFO] Finished at: Fri Aug 02 00:55:41 GMT+05:30 2013
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: Error reading POM -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
5: http://download.java.net/maven/2 -> com.sun.faces:simple-jsf (Archetype for creating a simple JSF project)
6: http://download.java.net/maven/2 -> com.sun.faces.regression:i_jsf_XXXX-archetype (Archetype for mojarra JSF regression tests)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 3
Define value for property 'groupId': : com.persistent
Define value for property 'artifactId': : jerseySpringJPA     
Define value for property 'version':  1.0-SNAPSHOT: : 
Define value for property 'package':  com.persistent: : com.persistent.rest
Confirm properties configuration:
groupId: com.persistent
artifactId: jerseySpringJPA
version: 1.0-SNAPSHOT
package: com.persistent.rest
 Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: jersey-quickstart-webapp:1.8
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.persistent
[INFO] Parameter: packageName, Value: com.persistent.rest
[INFO] Parameter: package, Value: com.persistent.rest
[INFO] Parameter: artifactId, Value: jerseySpringJPA
[INFO] Parameter: basedir, Value: /mwallet
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: /mwallet/jerseySpringJPA
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:04.013s
[INFO] Finished at: Fri Aug 02 01:49:42 GMT+05:30 2013
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
选择原型:
1: http://download.java.net/maven/2 ->jersey.原型:jersey quickstart-
grizzly(使用Jersey和grizzly创建RESTful web应用程序的原型)
2: http://download.java.net/maven/2 ->原型:jersey-quickstart-grizzly2(用于使用jersey和grizzly2.x创建RESTful web应用程序的原型)
三:http://download.java.net/maven/2 ->原型:jersey quickstart webapp(使用WAR打包创建基于jersey的RESTful web应用程序的原型)
4: http://download.java.net/maven/2 ->原型:jersey quickstart ejb(使用WAR打包创建基于jersey的RESTful ejb应用程序的原型)
5: http://download.java.net/maven/2 ->faces:SimpleJSF(创建简单jsf项目的原型)
6: http://download.java.net/maven/2 ->回归:i_jsf_XXXX-archetype(mojarrajsf回归测试的原型)
选择一个数字或应用筛选器(格式:[groupId:]artifactId,区分大小写)::3
定义属性“groupId”的值::com.persistent
定义属性“artifactId”的值:jerseySpringJPA
定义属性“版本”的值:1.0-SNAPSHOT::
定义属性“包”的值:com.persistent::com.persistent.rest
确认属性配置:
groupId:com.persistent
artifactId:jerseySpringJPA
版本:
包:com.persistent.rest
Y::Y
[信息]----------------------------------------------------------------------------
[信息]使用以下参数从旧(1.x)原型创建项目:jersey quickstart webapp:1.8
[信息]----------------------------------------------------------------------------
[INFO]参数:groupId,值:com.persistent
[信息]参数:packageName,值:com.persistent.rest
[信息]参数:包,值:com.persistent.rest
[INFO]参数:artifactId,值:jerseySpringJPA
[信息]参数:basedir,值:/mwallet
[信息]参数:版本,值:
[信息]------------------------------------------------------------------------
[信息]生成失败
[信息]------------------------------------------------------------------------
[信息]总时间:1:32.278秒
[信息]完成时间:2013年8月2日星期五00:55:41 GMT+05:30
[信息]最终内存:7M/81M
[信息]------------------------------------------------------------------------
[错误]无法在独立项目pom上执行目标org.apache.maven.plugins:maven原型插件:2.2:generate(默认cli):读取pom->[帮助1]时出错
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整调试日志记录。
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
我不知道为什么它不读POM。我有什么遗漏吗?请帮忙!
提前谢谢

我可以创建一个没有任何问题的模块。 请参阅所附的屏幕截图

您传递的版本号似乎不正确

谢谢

我解决了这个问题

为了

我最初输入的是教程中提到的。现在,我将其留白,这实际上使版本成为1.0-SNAPSHOT

这就解决了问题。现在构建成功了!以下是输出:

Choose archetype:
1: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-    
grizzly (Archetype for creating a RESTful web application with Jersey and Grizzly)
2: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-grizzly2 (Archetype for creating a RESTful web application with Jersey and Grizzly 2.x)
3: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-webapp (Archetype for creating a Jersey based RESTful web application with WAR packaging)
4: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-ejb (Archetype for creating a Jersey based RESTful EJB application with WAR packaging)
5: http://download.java.net/maven/2 -> com.sun.faces:simple-jsf (Archetype for creating a simple JSF project)
6: http://download.java.net/maven/2 -> com.sun.faces.regression:i_jsf_XXXX-archetype (Archetype for mojarra JSF regression tests)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 3
Define value for property 'groupId': : com.persistent
Define value for property 'artifactId': : jerseySpringJPA
Define value for property 'version':  1.0-SNAPSHOT: : <CR>
Define value for property 'package':  com.persistent: : com.persistent.rest
Confirm properties configuration:
groupId: com.persistent
artifactId: jerseySpringJPA
version: <CR>
package: com.persistent.rest
 Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: jersey-quickstart-webapp:1.8
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.persistent
[INFO] Parameter: packageName, Value: com.persistent.rest
[INFO] Parameter: package, Value: com.persistent.rest
[INFO] Parameter: artifactId, Value: jerseySpringJPA
[INFO] Parameter: basedir, Value: /mwallet
[INFO] Parameter: version, Value: <CR>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:32.278s
[INFO] Finished at: Fri Aug 02 00:55:41 GMT+05:30 2013
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: Error reading POM -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
5: http://download.java.net/maven/2 -> com.sun.faces:simple-jsf (Archetype for creating a simple JSF project)
6: http://download.java.net/maven/2 -> com.sun.faces.regression:i_jsf_XXXX-archetype (Archetype for mojarra JSF regression tests)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 3
Define value for property 'groupId': : com.persistent
Define value for property 'artifactId': : jerseySpringJPA     
Define value for property 'version':  1.0-SNAPSHOT: : 
Define value for property 'package':  com.persistent: : com.persistent.rest
Confirm properties configuration:
groupId: com.persistent
artifactId: jerseySpringJPA
version: 1.0-SNAPSHOT
package: com.persistent.rest
 Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: jersey-quickstart-webapp:1.8
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.persistent
[INFO] Parameter: packageName, Value: com.persistent.rest
[INFO] Parameter: package, Value: com.persistent.rest
[INFO] Parameter: artifactId, Value: jerseySpringJPA
[INFO] Parameter: basedir, Value: /mwallet
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: /mwallet/jerseySpringJPA
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:04.013s
[INFO] Finished at: Fri Aug 02 01:49:42 GMT+05:30 2013
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------

谢谢你的回复。你和我一样选择“数字”3了吗?是的。。尝试在调试模式下运行,然后查看失败的地方?我本来以为,这可能与版本有关:),但对我来说没有意义:(.无论如何,现在你可以继续你的教程了。非常感谢你的帮助!NP,请你将它标记为已回答并关闭它,这样它可以节省其他人的时间,他们可以专注于帮助其他人。对于版本来说,“谢谢”不是一个有效的值。如果你想给它,你可以像CR-1.0一样给它。
意味着
回车
或者换句话说,按
Return/Enter
表示
回车
,或者换句话说,按
Return/Enter