maven : Failed to execute goal org.apache.maven.plugin错误Generating project in Interactive mode提示解决方案

最近在学maven(maven能有效管理我们的jar包),在使用mvn命令创建maven项目的时候总是遇到Failed to execute goal org.apache.maven.plugin错误Generating project in Interactive mode提示,也查阅过不少资料,在这里分享一下我的解决方案!


我之前是使用以下mvn命令来创建maven项目

mvn archetype:create

程序输出以下错误信息

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-cli) on project standalone-pom: Unable to parse configuration of mojo org.apache.maven.plugins:maven-archetype-plugin:2.4:create for parameter #: Cannot create instance of interface org.apache.maven.artifact.repository.ArtifactRepository: org.apache.maven.artifact.repository.ArtifactRepository.<init>() -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException

分析原因:可能是create已经过时了

解决方案:我们用官方文档上提供的命令archetype:generate来代替create即可


然后我就是用修改后的命令再次执行创建项目

mvn archetype:generate

发现程序一直卡在这个提示信息

[INFO] Generating project in Interactive mode

分析原因:这是在向远程服务器抓取catalog,而远程服务器设在了国外,所以在国内访问比较慢,这也是为什么会有国内镜像存在的原因

解决方案1(推荐):在命令后面加上一些参数 -DarchetypeCatalog=internal

方案2(不推荐):一个字,等!!我刚才试了下等上几分钟就能继续往下执行了~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值