西乡书生 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条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!