问题描述:
在linux中用maven打包时出现如下报错:
图如下:
内容文字如下:
- [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版本的配置,既然之前版本那个不行,就根据报错提示的路径下得到的信息重新换一个版本。(当然,这治标不治本,成功与否还得看运气,所有弄清楚原因根治为最佳)