eclipse 中 maven的pom.xml文件发生错误:CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven...

简介: eclipse 中 maven的pom.xml文件发生错误:CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven...

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



78.png


79.pngimage.png


2、解决:在eclipse中强制更新maven的项目:快捷键 alt+f5,然后勾选 Force Update of Snapshots/Releases


81.png


✿ 补充一下 maven的环境搭建


Maven 环境搭建

一、准备工作:

1、maven下载:官网:https://maven.apache.org/download.cgi

  • 下载完成后解压出来

2、配置环境变量

  • 细节:为什么要单独配置一个M2_HOME 的变量:方便后续学习
  • 后续使用的自动依赖的系统,比如SpringBoot、SpringCloud,它会引用M2_HOME 这个地址。

■ 添加系统变量:

□ M2_HOME maven目录下的bin目录

□ MAVEN_HOME maven的目录

□ 在系统的path中配置 %MAVEN_HOME%\bin


82.png83.png


■ 验证maven是否配置成功:查看maven版本的命令 mvn -version


84.png


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>
目录
相关文章
|
2月前
|
Java Maven
Maven编译报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile 解决方案
在执行Maven项目中的`install`命令时,遇到编译插件版本不匹配的错误。具体报错为:`maven-compiler-plugin:3.13.0`要求Maven版本至少为3.6.3。解决方案是将Maven版本升级到3.6.3或降低插件版本。本文详细介绍了如何下载、解压并配置Maven 3.6.3,包括环境变量设置和IDEA中的Maven配置,确保项目顺利编译。
2614 4
Maven编译报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile 解决方案
|
3月前
|
Java 测试技术 Maven
Maven clean 提示文件 java.io.IOException
在使用Maven进行项目打包时,遇到了`Failed to delete`错误,尝试手动删除目标文件也失败,提示`java.io.IOException`。经过分析,发现问题是由于`sys-info.log`文件被其他进程占用。解决方法是关闭IDEA和相关Java进程,清理隐藏的Java进程后重新尝试Maven clean操作。最终问题得以解决。总结:遇到此类问题时,可以通过任务管理器清理相关进程或重启电脑来解决。
|
3月前
|
XML Android开发 数据格式
Eclipse 创建 XML 文件
Eclipse 创建 XML 文件
51 2
|
3月前
|
Java Maven
maven项目的pom.xml文件常用标签使用介绍
第四届人文,智慧教育与服务管理国际学术会议(HWESM 2025) 2025 4th International Conference on Humanities, Wisdom Education and Service Management
299 8
|
4月前
|
缓存 IDE Java
idea的maven项目打包时没有source下的文件
【10月更文挑战第21天】idea的maven项目打包时没有source下的文件
214 1
|
4月前
|
Java Maven
用graalvm将maven项目打包成可执行文件
本文介绍了如何使用GraalVM将Maven项目打包成可执行文件,包括引入依赖和插件、编写代码、执行打包命令以及运行查看结果的完整过程。
270 0
用graalvm将maven项目打包成可执行文件
|
6月前
|
Java Maven Spring
SpringBoot 系列之 Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resource
这篇文章描述了在使用Maven构建Spring Boot项目时遇到的`maven-resources-plugin`插件版本问题导致的编译失败,并提供了通过修改插件版本至3.1.0来解决这个问题的方法。
SpringBoot 系列之 Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resource
|
6月前
|
Java Maven Spring
Maven重打包问题之maven-shade-plugin插件对于重复的class文件会如何处理
Maven重打包问题之maven-shade-plugin插件对于重复的class文件会如何处理
131 2
|
Java Apache Maven
Eclipse创建maven项目时,出现Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources错
Eclipse创建maven项目时,出现Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources错
390 0
Eclipse创建maven项目时,出现Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources错
|
Java 关系型数据库 MySQL
如何在Eclipse中搭建MyBatis基本开发环境?(使用Eclipse创建Maven项目)
如何在Eclipse中搭建MyBatis基本开发环境?(使用Eclipse创建Maven项目)
424 0
如何在Eclipse中搭建MyBatis基本开发环境?(使用Eclipse创建Maven项目)

热门文章

最新文章

推荐镜像

更多