关于创建maven web项目Could not calculate build plan

1.环境

win10
jdk13
Eclipse IDE for Enterprise Java Developers Version: 2019-12 (4.14.0)
apache-maven-3.6.3

2. 场景,在Eclipse创建maven项目

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.2 or one of its dependencies could not be resolved: Failure to transfer org.apache.maven.plugins:maven-war-plugin:jar:2.2 from https://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus-aliyun has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-war-plugin:jar:2.2 from/to nexus-aliyun (https://maven.aliyun.com/nexus/content/groups/public/): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Plugin org.apache.maven.plugins:maven-war-plugin:2.2 or one of its dependencies could not be resolved: Failure to transfer org.apache.maven.plugins:maven-war-plugin:jar:2.2 from https://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus-aliyun has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-war-plugin:jar:2.2 from/to nexus-aliyun (https://maven.aliyun.com/nexus/content/groups/public/): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

3.问题及解决办法

通过调试发现原因,maven镜像配置问题如下:

<!-- 阿里云 Maven 镜像服务器配置 -->
  <mirror>
   <id>nexus-aliyun</id>
   <name>Nexus aliyun</name>
   <mirrorOf>*</mirrorOf>
   <!--https为报错的配置 -->
   <url>https://maven.aliyun.com/nexus/content/groups/public/</url>
  </mirror>
<!-- 阿里云 Maven 镜像服务器配置 -->
  <mirror>
   <id>nexus-aliyun</id>
   <name>Nexus aliyun</name>
   <mirrorOf>*</mirrorOf>
   <!--http为报错的配置,问题解决 -->
   <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  </mirror>
发布了14 篇原创文章 · 获赞 0 · 访问量 6452
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章