报错信息
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0
Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from https://repo.maven.apache.org... was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org... Server sent an unsupported extension: type_35
Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from https://repo.maven.apache.org... was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org... Server sent an unsupported extension: type_35
如上述信息,试了几种方法,均未解决,只好来求助(老项目jar包下一半报错,任何maven新项目创建不了)我的maven的版本是3.5.0
ps:重装系统之前还能使用,难道和系统有关系吗?
这个应该是你本地的repository中没有你要使用的archetype造成的,你试一下在创建maven项目的时候不使用任何archetype应该会成功。
至于原因是因为当是用archetype创建maven项目的时候,如果本地没有archetype相关依赖,这个时候maven会去中央仓库下载对应依赖,而maven中央仓库下载速度太慢,如果下载失败,就会报你上面的错误。另外推荐用国内的仓库,配置方式如下:
vim /Users/xxx/.m2/settings.xml
在配置文件中添加如下配置:
<mirrors>
</mirrors>
输入:wq保存即可
上面是macOS的配置方法,windows可以参考上面的配置