西乡书生 2010-12-29 15:06
浏览 457
已采纳

maven archetype:generate的问题

在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个左右,好像),就可以解决你的烦恼了

 

但是我试验了下还是不行

 

 

 

  • 写回答

4条回答 默认 最新

  • CaiHuajiang 2010-12-29 15:57
    关注

    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
    你的地址在服务器黑名单中了,可能是你下载的次数太多了。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 flink cdc无法实时同步mysql数据
  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名