mvn archetype:生成BUILD FAILURE

时间:2013-08-01 19:41:12

标签: maven-2 maven-archetype

我正在关注教程:http://persistentdesigns.com/wp/jersey-spring-and-jpa/ 在这里,它说,运行命令

mvn archetype:generate -DarchetypeCatalog=http://download.java.net/maven/2

之后给groupId,ArtifactId等我运行上面的命令。但在要求groupId之前,它要求:

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

因为,在教程中没有给出这个数字,我在命令行中查看了给定的选项并选择了3.之后它要求groupId和其他。我给了所有选项然后按下回车键。但我得到一个构建失败,说错误读取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

我不知道它为什么不读POM。我在这里错过了什么吗?请帮忙! 提前谢谢!

2 个答案:

答案 0 :(得分:1)

我解决了这个问题!

有关

Define value for property 'version':  1.0-SNAPSHOT: :

我最初进入&lt; CR&gt;正如教程中提到的那样。现在,我将它留空,这实际上使版本为1.0-SNAPSHOT。

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

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 :(得分:0)

我能够毫无问题地创建模块。 请参阅随附的屏幕截图。

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

enter image description here

由于