maven 项目无法打包

当使用IDEA的Maven项目进行打包时遇到错误。报错信息提示某些问题,通过在Maven的Runner设置中添加VM Options配置可以解决编译问题,但仍然无法完成install打包。错误的根本原因在于Maven的镜像配置不正确,修正镜像链接后,问题得到解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编译打包报错

环境

IDEA maven 项目正常打包
控制台运行mvn install -DskipTests

报错问题:

[ERROR] Failed to execute goal on project cad: Could not resolve dependencies for project com.zih:cad:jar:0.0.1-SNAPSHOT: Failed to col
lect dependencies at org.springframework.boot:spring-boot-starter-amqp:jar:2.1.4.RELEASE: Failed to read artifact descriptor for org.sp
ringframework.boot:spring-boot-starter-amqp:jar:2.1.4.RELEASE: Could not transfer artifact org.springframework.boot:spring-boot-starter
-amqp:pom:2.1.4.RELEASE from/to nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public): Transfer failed for http://maven.al
iyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-amqp/2.1.4.RELEASE/spring-boot-starter-amqp-2.1.4.REL
EASE.pom: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExcept
ion: 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/DependencyResolutionException

或者报错

sun.security.validator.ValidatorException: PKIX path building failed

解决办法

修改添加配置信息:
Maven > Runner > VM Options 添加如下内容:
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
在这里插入图片描述
添加该配置,Compile可以正常,但是无法install打包
最终还是maven 配置中镜像链接有问题,最终改成

	<mirror>
		<id>aliyunmaven</id>
		<mirrorOf>central</mirrorOf>
		<name>aliyun maven</name>
		<url>https://repo1.maven.org/maven2/</url>
	</mirror>

更详细

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值