在Maven中创建web项目时报错Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0

在Maven中创建web项目时报错Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0


Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from an

无法从任何已经配置的库里面解析 org.apache.maven.archetypes:maven-archetype-webapp:1.0。
是因为缺少webapp 这个包
第二段第一句话:从https://repo.maven.apache.org/maven2下载org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0失败。
所以问题是org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0这个包在创建maven web项目时maven找不到,或者是找到了但没有办法解析。
当找不到或者无法解析时,如果没有为maven配置远程仓库,就无法从远程仓库下载下来。
解决办法
1.先在CMD中输入mvn help:system命令行,执行后会自动下载所需东西。
2.下载结束后,输入命令:mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false?
全部下载完成后项目就可以创建了
此时会下载所需要的项目jar包,等待下载完毕就可以创建项目了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值