2013-08-01 71 views
0

我的教程如下:http://persistentdesigns.com/wp/jersey-spring-and-jpa/ 这表示,运行命令MVN原型:产生构建失败

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。我在这里错过了什么吗?请帮忙! 在此先感谢!

+0

'''意味着运输Return'或者换句话说,按'回车/ Enter' –

回答

0

我能够创建一个没有任何问题的模块。 请参阅附件截图。

看起来像你通过的版本号是不正确的。

enter image description here

感谢

+0

感谢您的答复。你是否像我一样选择了“数字3”? – kajarigd

+0

是的..尝试运行在调试模式,然后看看它失败的地方? – saurav

+0

当我将版本保留为空时,问题得到解决! – kajarigd

0

我解决这个问题!

对于

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

我最初进入< CR>如在教程提及。现在,我将它留空,实际上使版本为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] ------------------------------------------------------------------------ 
+0

不是版本的有效值。如果你想给你可以像CR-1.0一样给它。 – saurav

+0

''表示'回车'或换句话说,按'Return/Enter' –