Maven打Jar包报错:execute goal..repackage..unable to find valid certification path to requested target

错误:

Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.4:repackage (repackage) on project MemsRELTest: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.5.4:repackage failed: Plugin org.springframework.boot:spring-boot-maven-plugin:2.5.4 or one of its dependencies could not be resolved: Failed to collect dependencies at org.springframework.boot:spring-boot-maven-plugin:jar:2.5.4 -> org.springframework.boot:spring-boot-buildpack-platform:jar:2.5.4 -> org.apache.httpcomponents:httpclient:jar:4.5.13 -> org.apache.httpcomponents:httpcore:jar:4.4.13: Failed to read artifact descriptor for org.apache.httpcomponents:httpcore:jar:4.4.13: Could not transfer artifact org.apache.httpcomponents:httpcore:pom:4.4.13 from/to nexus-aliyun (https://maven.aliyun.com/repository/public): Transfer failed for https://maven.aliyun.com/repository/public/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.pom ProxyInfo{host='10.10.2.93', userName='null', port=8080, type='https', nonProxyHosts='null'}: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------< com.local.project.sae.mes:MemsRELTest >----------------
[INFO] Building MemsRELTest 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:copy-resources (copy-xmls) @ MemsRELTest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory D:\RomanData\WorkSpace\MemsRELTest_jar\files
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ MemsRELTest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 4 resources
[INFO] Copying 15 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ MemsRELTest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 127 source files to D:\RomanData\WorkSpace\MemsRELTest_jar\target\classes
[INFO] /D:/RomanData/WorkSpace/MemsRELTest_jar/src/main/java/com/saet/mems/base/config/ApplicationConfigurer.java: Some input files use or override a deprecated API.
[INFO] /D:/RomanData/WorkSpace/MemsRELTest_jar/src/main/java/com/saet/mems/base/config/ApplicationConfigurer.java: Recompile with -Xlint:deprecation for details.
[INFO] /D:/RomanData/WorkSpace/MemsRELTest_jar/src/main/java/com/saet/mems/org/tempuri/ORTLocator.java: Some input files use unchecked or unsafe operations.
[INFO] /D:/RomanData/WorkSpace/MemsRELTest_jar/src/main/java/com/saet/mems/org/tempuri/ORTLocator.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ MemsRELTest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory D:\RomanData\WorkSpace\MemsRELTest_jar\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ MemsRELTest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to D:\RomanData\WorkSpace\MemsRELTest_jar\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ MemsRELTest ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ MemsRELTest ---
[INFO] Building jar: D:\RomanData\WorkSpace\MemsRELTest_jar\target\MemsRELTest-0.0.1.jar
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.5.4:repackage (repackage) @ MemsRELTest ---
[INFO] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/public/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.pom
[INFO] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/public/org/apache/maven/shared/maven-common-artifact-filters/3.2.0/maven-common-artifact-filters-3.2.0.pom
[INFO] Downloading from nexus-aliyun: https://maven.aliyun.com/repository/public/org/apache/maven/plugins/maven-shade-plugin/3.2.4/maven-shade-plugin-3.2.4.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  14.509 s
[INFO] Finished at: 2024-06-07T10:26:15+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.4:repackage (repackage) on project MemsRELTest: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.5.4:repackage failed: Plugin org.springframework.boot:spring-boot-maven-plugin:2.5.4 or one of its dependencies could not be resolved: Failed to collect dependencies at org.springframework.boot:spring-boot-maven-plugin:jar:2.5.4 -> org.springframework.boot:spring-boot-buildpack-platform:jar:2.5.4 -> org.apache.httpcomponents:httpclient:jar:4.5.13 -> org.apache.httpcomponents:httpcore:jar:4.4.13: Failed to read artifact descriptor for org.apache.httpcomponents:httpcore:jar:4.4.13: Could not transfer artifact org.apache.httpcomponents:httpcore:pom:4.4.13 from/to nexus-aliyun (https://maven.aliyun.com/repository/public): Transfer failed for https://maven.aliyun.com/repository/public/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.pom ProxyInfo{host='10.10.2.93', userName='null', port=8080, type='https', nonProxyHosts='null'}: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

重点信息:unable to find valid certification path to requested target

原因:在 SSL/TLS 握手过程中,证书路径验证失败。这通常是由于缺少或不受信任的证书导致的,Maven 无法与远程仓库建立安全连接

解决办法:

1、更新java版本,java9以上自带证书

2、导入证书,参考链接

3、禁用证书验证,参考链接

4、以上不能解决,考虑maven的proxy代理问题。

参考:Maven 私服 unable to find valid certification path to requested target 错误_maven unable to find valid certification path to r-CSDN博客

  • 22
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值