1、 报错信息如下:
Description Resource Path Location Type
CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 -> org.apache.maven.shared:maven-shared-incremental:jar:1.1 -> org.apache.maven:maven-core:jar:2.2.1 -> org.apache.maven:maven-profile:jar:2.2.1: ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-profile:jar:2.2.1: ArtifactResolutionException: org.apache.maven:maven-profile:pom:2.2.1 failed to transfer from http://maven.aliyun.com/nexus/content/groups/public during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of nexus-aliyun has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-profile:pom:2.2.1 from/to nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public): The operation was cancelled. pom.xml /ssm-xml-demo line 6 Maven Project Build Lifecycle Mapping Problem
2、解决:在eclipse中强制更新maven的项目:快捷键 alt+f5,然后勾选 Force Update of Snapshots/Releases
✿ 补充一下 maven的环境搭建
Maven 环境搭建
一、准备工作:
1、maven下载:官网:https://maven.apache.org/download.cgi
- 下载完成后解压出来
2、配置环境变量
:
■ 添加系统变量:
□ M2_HOME maven目录下的bin目录
□ MAVEN_HOME maven的目录
□ 在系统的path中配置 %MAVEN_HOME%\bin
■ 验证maven是否配置成功:查看maven版本的命令 mvn -version
3、修改maven 配置文件的镜像为 阿里云镜像
-
配置文件位置:maven根目录/conf/settings.xml 找到镜像元素mirrors
-
镜像:mirrors:
- 作用:加速下载
- 默认是使用国外的镜像,国内建议使用
阿里云
镜像加速下载
<!-- 添加之前,先把原来的镜像全注释掉 --> <!-- 配置方式1 --> <mirror> <id>nexus-aliyun</id> <mirrorOf>*,!jeecg,!jeecg-snapshots</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirror>
<!-- 配置方式2 -->
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
4、修改maven 配置文件的本地仓库位置
- 修改本地仓库位置为:maven 根目录下 自己手动建立的 maven-repo
- 配置文件位置:maven根目录/conf/settings.xml 找到 localRepository元素
<localRepository>E:\environment\mavenEvironment\apache-maven-3.8.2\maven-repo</localRepository>