在dos中输入 mvn archetype:generat后显示了大概50个原型选项
然后出现了choose a number:16:
这不就是明摆着 只可以选择16吗
我就不服气啊 我就输入了一个11 然后回车
然后maven 就报错了
Choose a number: 16: 11
[INFO] artifact org.apache.maven.archetypes:maven-archetype-j2ee-simple: checkin
g for updates from central
[WARNING] repository metadata for: 'artifact org.apache.maven.archetypes:maven-a
rchetype-j2ee-simple' could not be retrieved from repository: central due to an
error: Authorization failed: Access denied to: http://repo1.maven.org/maven2/org
/apache/maven/archetypes/maven-archetype-j2ee-simple/maven-metadata.xml
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] The desired archetype does not exist (org.apache.maven.archetypes:maven-a
rchetype-j2ee-simple:RELEASE)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 minutes 35 seconds
大侠给点指点啊 小弟这里感谢了 谢谢
曾经看到过下面的解决方法:
可以使用 $mvn archetype:generate -DarchetypeCatalog=internal
archetypeCatalog
表示插件使用的archetype元数据,默认值为remote,local,即中央仓库archetype元数据
(http://repo1.maven.org/maven2/archetype-catalog.xml)加上插件内置元数据的和
由于中央仓库的archetype太多,导致这个列表太长
因此自己指定仅用内置元数据(20个左右,好像),就可以解决你的烦恼了
但是我试验了下还是不行