在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个左右,好像),就可以解决你的烦恼了
但是我试验了下还是不行
Choose a number: 16:
这里表示的是在上面提示的列表中选择一个原型下载,16应该是默认值,通常应该是maven-archetype-quickstart。
也就是说,你能选择其中任意一个,当然可以选11。
你的错误在于
[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
你没有通过服务器的验证,通常是不会的,主要是因为Repository 'central' will be blacklisted
你的地址在服务器黑名单中了,可能是你下载的次数太多了。
从来都是利用eclipse的maven插件来做这个事情的,你不妨试试吧。。
不要使用插件的maven,自己下一个maven
关掉卡巴,360,防火墙再试试