将 Maven 项目导入 Eclipse 时出现以下错误:
No marketplace entries exec-maven-plugin:1.2.1 error
而且它看起来会导致导入后进一步的构建问题 - 就像
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:exec-maven-plugin:1.2.1:java (execution: default, phase: generate-sources)
是我缺少插件还是我的 pom.xml 有问题?
已安装的 m2e:
m2e - Maven Integration for Eclipse (includes Incubating components) 1.5.0.20131218-1208 org.eclipse.m2e.feature.feature.group Eclipse.org - m2e
Eclipse Java Development Tools 3.8.2.v20130116-090414-8-8nFu3FNOfwKLRuqgXKIy9z0I83 org.eclipse.jdt.feature.group Eclipse.org
Eclipse Platform 4.2.1.v20130118-173121-9MF7GHYdG0B5kx4E_SkfZV-1mNjVATf67ZAb7 org.eclipse.platform.feature.group Eclipse.org
Eclipse RCP 4.2.2.v20130129-152330-7IARAABrMQkGSvMgQnUlz-DQz00h org.eclipse.rcp.feature.group Eclipse.org
提前致谢。
最佳答案
问题是 Eclipse 的 m2e 插件不知道 exec-maven-plugin 你可以通过以下方式解决:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<versionRange>[1.2.1,)</versionRange>
<goals>
<goal>java</goal>
<goal>exec</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
关于java - Eclipse 中的 exec-maven-plugin :1. 2.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21721846/