【Exception】[ERROR] Plugin org.apache.maven.plugins:maven-enforcer-plugin:1.4 or one of its dependenc

Talk is cheap, show me the code.

环境 | Environment

kversion
OSwindows 11
jdk1.8
maven3.6.0
junitjunit4 mian

复现步骤 | Reproduction steps

  1. git clone git@github.com:tanpenggood-fork/junit4.git
  2. cd junit4
  3. mvn verify

报错日志 | Error log

[ERROR] Plugin org.apache.maven.plugins:maven-enforcer-plugin:1.4 or one of its dependencies

原因分析 | Analysis

阿里的镜像更新了,所以用https了而不是http

解决方案 | Solution

  1. settings.xml url 使用https

    <?xml version="1.0" encoding="UTF-8"?>
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    
    	<pluginGroups>
    	</pluginGroups>
    
    	<proxies>
    	</proxies>
    
    	<servers>
    	</servers>
    
    	<mirrors>
    		<!-- 阿里云镜像 -->
    		<mirror>
    			<id>aliyun</id>
    			<name>aliyun Maven</name>
    			<mirrorOf>*</mirrorOf>
    			<url>https://maven.aliyun.com/nexus/content/groups/public/</url>
    		</mirror>
    	</mirrors>
    
    	<profiles>
    	</profiles>
    	
    		<activeProfiles>
    	</activeProfiles>
    </settings>
    
  2. VIM Options 开启 ssl证书验证

    -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true
    

    在这里插入图片描述

参考 | References

CSDN - 解决IDEA的Plugin org.apache.maven.pluginsmaven-archetype-pluginRELEASE or one of its dependencies

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值