1. 环境:jdk1.8、maven3.8.3、idea2021版
2. settings.xml配置如下
<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
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>/usr/local/maven3.8.3/maven_repo</localRepository>
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
</settings>
3. 使用idea新建maven项目出现错误
Unresolved plugin: 'org.apache.maven.plugins:maven-resources-plugin:2.6'
Unresolved plugin: 'org.apache.maven.plugins:maven-jar-plugin:2.4'
Unresolved plugin: 'org.apache.maven.plugins:maven-compiler-plugin:3.1'
Unresolved plugin: 'org.apache.maven.plugins:maven-surefire-plugin:2.12.4'
Unresolved plugin: 'org.apache.maven.plugins:maven-deploy-plugin:2.7'
Unresolved plugin: 'org.apache.maven.plugins:maven-site-plugin:3.3'
4. 解决方法
4.1 maven改成3.6.3版本
4.2 修改maven本地仓库的权限
sh-3.2# chmod 777 /usr/local/maven3.6.3/maven_repo