当在maven中打包时,报错以下内容:
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced
解决方案:
1、下载 https://github.com/mfriedenhagen/dummy-lifecycle-mapping-plugin
2、解压,进入pom文件所在目录,执行mvn clean install
3、再次打包
在第二步可能会遇见错误提示:不再支持源选项 5。请使用 7 或更高版本
我本地解决方案是:
1.更换jdk为1.8,保持与之前开发环境jdk一致
2.从https://github.com/mfriedenhagen/dummy-lifecycle-mapping-plugin下载的压缩包后进行解压,将解压后的pom.xml打开,在<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>后面添加
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>