maven-compiler-plugin:X.X.X or one of its dependencies could not be resolved

问题描述:

在linux中用maven打包时出现如下报错:
图如下:
bug

内容文字如下:

  • [ERROR] Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.8.0: 1 problem was encountered while building the effective model
    [ERROR] [FATAL] Non-parseable POM /opt/bigdata/mvnJar/org/apache/maven/plugins/maven-compiler-plugin/3.8.0/maven-compiler-plugin-3.8.0.pom: entity reference name can not contain character =’ (position: START_TAG seen …/index.jsp?wlanuserip=dab5c972f92843e7fc80264d69922f1b&wlanacname=… @1:123) @ line 1, column 123

解决方案:

网上一堆原因,太菜了,没看懂。就直接写我的解决方案吧。
首先是内容显示是maven-compiler-plugin这个地方发生错误:如下标记位置:
在这里插入图片描述
于是去到我执行maven打包命令的路径下查看pom.xml关于maven-compiler-plugin的相关配置,未修改之前的配置如下图:
未修改前
结合刚刚第二个错误报错的地方的(用荧光标记的部分)如下图所示:
注意标记部分
上面显示我的/opt/bigdata/mvnJar/org/apache/maven/plugins/maven-compiler-plugin/3.8.0/下出了问题,于是我到/opt/bigdata/mvnJar/org/apache/maven/plugins/maven-compiler-plugin/这个路径下:
到指定路径下
发现处了上面配置的3.8.0外,还有2.3.2,3.1等版本(可能是之前其他同学用过的),于是很菜的我决定修改pom.xml中的相关配置,修改为除报错的3.8.0这个版本外的其他版本。
于是有了如下修改:
修改后
修改后保存,重新执行打包命令以后正常。
总结下来就是修改pom.xml中关于maven-compiler-plugin版本的配置,既然之前版本那个不行,就根据报错提示的路径下得到的信息重新换一个版本。(当然,这治标不治本,成功与否还得看运气,所有弄清楚原因根治为最佳)

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值