最近将项目的代码JDK版本基准从jdk1.7升级到jdk1.8,在升级的过程出了一堆问题。
在重新用java 8编译一个maven插件的时候报错了:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor (default-descriptor) on project swift2thrift-maven-plugin: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor failed: 52264
妈蛋,我的项目代码啥都木有改,只是换到java 8编译呀。
google上搜索一下,很快找到答案,确实与java 版本有关:升级到java 8后相应的maven插件也要升级
解决办法如下图描述,只要在pom.xml中显式的指定maven-plugin-plugin的版本号就可以了(上面的错误描述就可以看出,原本我的pom.xml中没有maven-plugin-plugin的版本号,所以使用的是默认的版本3.2):

参见 maven-plugin-plugin:descriptor goal fails at the and of file

本文记录了从Java 1.7升级到Java 1.8过程中遇到的Maven插件版本不兼容问题及解决方案。主要介绍了如何通过指定maven-plugin-plugin版本号来解决编译错误。
1044





