問題:
1.新建項目后會提示一個這樣的錯
maven-compiler-plugin:3.1:compile(1 errors)
maven-compiler-plugin:3.1:testCompile(1 errors)
2.關掉后看pom.xml
3.plugin標簽也報錯,無法解析
鼠標放紅叉上提示
錯誤:
CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to read artifact
descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: UnresolvableModelException: Failure to transfer org.apache.maven:maven-parent:pom:23 from
http://maven.aliyun.com/
nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced. Original error: Could
not transfer artifact org.apache.maven:maven-parent:pom:23 from/to alimaven (
http://maven.aliyun.com/nexus/content/groups/public/): sun.security.validator.ValidatorException: PKIX path
building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-testCompile, phase: test-compile)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (execution: default-compile, phase: compile)
descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1: UnresolvableModelException: Failure to transfer org.apache.maven:maven-parent:pom:23 from

nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced. Original error: Could
not transfer artifact org.apache.maven:maven-parent:pom:23 from/to alimaven (

building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-testCompile, phase: test-compile)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (execution: default-compile, phase: compile)
解決:
排查eclipse配置maven的地方,和配置的倉庫都沒問題
再排查settings.xml,可以嘗試更換鏡像的配置,但我不是這個問題(可以換成下面這個,是我成功后的)
<mirrors> <mirror> <id>nexus-aliyun</id> <mirrorOf>*</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirror> </mirrors>
因為錯誤是說解析不了plugin,我猜想是上次更新時強制關閉eclipse導致某些包沒更新好,然后導致版本問題之類的總之無法解析出來報錯,就重新換了一個倉庫,就成功了
我認為應該是你自己的maven倉庫里\org\apache\maven目錄下的一些關於plugin的包受損了 ,也可以嘗試只更換別人好的maven文件夾,或者全部刪掉plugin的相關包重新下載