我正在尝试使用Spring Data和Neo4j。我开始尝试遵循这个由主站点链接的指南。特别地,我基于“Hello, World!”示例文件创建了pom.xml。这是从我的pom.xml中截取的导致问题的插件…
<plugin>
<!-- Required to resolve aspectj-enhanced class features -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<outxml>true</outxml>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
<aspectLibrary>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
</aspectLibrary>
</aspectLibraries>
<source>1.6</source>
<target>1.6</target>
</configuration>
<executions>
<!-- ERROR HERE IN ECLIPSE SEE BELOW FOR FULL MESSAGE -->
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
我看到的错误是:
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.0:compile (execution: default, phase: process-classes)
- Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.0:test-compile (execution: default, phase: process-classes)
我运行的是Eclipse 3.6.2和m2e 0.13。我不是Maven专家,所以如果可能的话,请在您的回答中说明清楚。
我也尝试了m2e 1.0.0通过这个更新网站,仍然得到相同的错误。
真是一团糟。我不记得我在哪里找到了这个,但我必须添加以下内容才能让M2Eclipse满意。更令人难过的是,要理解为什么需要这个标记并不容易。
<build>
... various plugins ...
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse
m2e settings only. It has no influence on the Maven build itself. -->
<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>aspectj-maven-plugin</artifactId>
<versionRange>[1.0,)</versionRange>
<goals>
<goal>test-compile</goal>
<goal>compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
M2Eclipse插件还有许多其他问题,无法与Spring Data一起工作。最后,我禁用了M2Eclipse,改用Apache Eclipse插件。
见https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html。
To solve some long-standing issues,
m2e 1.0 requires explicit instructions
what to do with all Maven plugins
bound to "interesting" phases of
project build lifecycle. We call these
instructions "project build lifecycle
mapping" or simply "lifecycle mapping"
because they define how m2e maps
information from project pom.xml file
to Eclipse workspace project
configuration and behaviour during
Eclipse workspace build.
Project build lifecycle mapping
configuration can be specified in
project pom.xml, contributed by
Eclipse plugins and there is also
default configuration for some
commonly used Maven plugins shipped
with m2e. We call these "lifecycle
mapping metadata sources". m2e will
create error marker like below for all
plugin executions that do not have
lifecycle mapping in any of the
mapping metadata sources.
Plugin execution not covered by lifecycle configuration:
org.apache.maven.plugins:maven-antrun-plugin:1.3:run
(execution: generate-sources-input, phase: generate-sources)
m2e matches plugin
executions to actions using
combination of plugin groupId,
artifactId, version range and goal.
There are three basic actions that m2e
can be instructed to do with a plugin
execution -- ignore, execute and
delegate to a project configurator.
我在用
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>runSomeAntTasks</id>
<phase>test-compile</phase>
.
.
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
然后改成了
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>runSomeAntTasks</id>
<phase>integration-test</phase>
.
.
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
错误消失了。也许不建议将执行绑定到测试-编译阶段,因此寻找一个不同的阶段可能是向maven生命周期添加插件管理配置的替代解决方案。
转到workspace/rtc-ws/.metadata/.plugins/org.eclipse.m2e.core/lifecycle-mapping-metadata.xml,然后创建lifecycle-mapping-metadata.xml文件,并按如下方式粘贴并重新加载配置
如果你正在使用Eclipse 4.2,在映射方面有问题,并且不想把乱七八糟的东西放到pom.xml中,创建一个新的文件Lifecycle -mapping-metadata.xml,在Windows中配置它-> Preferences -> Lifecycle mapping(不要忘记在每次更改这个文件后按Reload workspace Lifecycle mappings metadata !)下面是基于eclipse/plugins/org.eclipse.m2e.lifecyclemapping. defaults_3 .2.0.20120903-1050.jar/ lifeccycle -mapping-metadata.xml的示例
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<goals>
<goal>create-timestamp</goal>
</goals>
<versionRange>[0.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<goals>
<goal>list</goal>
</goals>
<versionRange>[0.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<goals>
<goal>generate</goal>
</goals>
<versionRange>[0.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<goals>
<goal>compile</goal>
</goals>
<versionRange>[0.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<goals>
<goal>copy-dependencies</goal>
<goal>unpack</goal>
</goals>
<versionRange>[0.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<versionRange>[1.7,)</versionRange>
<goals>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<versionRange>[2.8,)</versionRange>
<goals>
<goal>check</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
我今天遇到了这个问题。我使用的是STS 3.4及其捆绑的Roo 1.2.4。后来我尝试用Eclipse Kepler和Roo 1.2.5,同样的错误。
我已经改变了我的pom.xml在构建之后和在插件声明之前添加pluginTemplates标签,但没有工作。
是什么让我如此着迷:
使用jdk 1.7.0_51
下载了Roo 1.2.5
下载Maven 3.2.1(如果没有,当执行“perform eclipse”时出现“error=2,没有这样的文件或目录”)
配置的JDK, Roo和Maven bin目录在我的PATH:
导出路径= / opt / jdk1.7.0_51 / bin:美元的道路
导出路径= / opt / spring-roo-1.2.5.RELEASE / bin:美元的道路
导出路径= / opt / apache-maven-3.2.1 / bin:美元的道路
我的配置如下:
(http://docs.spring.io/spring-roo/reference/html/beginning.html)
$ mkdir hello
$ cd hello
$ roo.sh
roo> project --topLevelPackage com.foo
roo> jpa setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT
roo> web mvc setup
roo> perform eclipse
打开Eclipse(没有STS,但我猜它工作):导入>现有项目到工作区
在Eclipse Luna 4.4.0中,您可以在首选项中选择忽略此错误
窗口>首选项> Maven >错误/警告>插件执行没有被生命周期配置覆盖。选择忽略/警告/错误。
此外,在此错误的快速修复(Ctrl + 1)中,它提供了一个选项
在Eclipse首选项中将目标标记为忽略(实验性)
这是一种更干净的方式,因为它不会修改pom.xml。
您将需要执行Maven > Update项目来修复任何其他项目中的相同错误。
在STS(Spring-tool-suite)中,您可以在首选项中选择忽略此错误
窗口>首选项> Maven >错误/警告>生命周期配置未覆盖插件执行。选择忽略/警告/错误。
然后。右键单击项目,单击Maven并更新项目,然后错误就会消失。