關於創建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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章