2013-01-09 145 views
0

我正在尝试使用Struts wiki中指出的struts2-archetype-blank原型来设置Struts2项目。
Struts2 maven原型

mvn archetype:generate -B -DgroupId=tutorial -DartifactId=tutorial -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-blank -DarchetypeVersion=2.1.8 

不过,我得到以下错误:

[INFO] Archetype repository missing. Using the one from [org.apache.struts:strus2-archetype-blank:2.3.8] found in catalog remote 
Downloading: http://repo1.maven.org/maven2/org/apache/struts/struts2-archetype- 
lank/2.1.8/struts2-archetype-blank-2.1.8.jar 
[INFO] ------------------------------------------------------------------------<br/> 
[INFO] BUILD FAILURE<br/> 
[INFO] ------------------------------------------------------------------------<br/> 
[INFO] Total time: 5.829s<br/> 
[INFO] Finished at: Wed Jan 09 10:10:26 CET 2013<br/> 
[INFO] Final Memory: 7M/17M<br/> 
[INFO] ------------------------------------------------------------------------<br/> 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist <br/>(org.apache.struts:struts2-archetype-blank:2.1.8) -> [Help 1]<br/> 
[ERROR] 

我需要一个特定的仓库在我的Maven的配置使用这个原型?

+3

错字?看看错误消息,有[...:strus ..]而不是struts。至少我发现它在这里:https://repository.apache.org/index.html#nexus-search;gav~~struts2-archetype-blank~~~ – Adrian

+0

阿德里安,这应该是一个答案国际海事组织 –

回答

1

我想你可以只使用

mvn archetype:generate -B -DgroupId=tutorial -DartifactId=tutorial -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-blank 

没有

-DarchetypeVersion=2.1.8

使用可用的最新版本(2.3.8目前)的2.1.8是不是在中央回购可用。