我正在尝试使用Spring Data 和 Neo4j。我首先尝试遵循主站点链接的本指南。特别是我的 pom.xml 来自“Hello, World!”。示例文件。这是我的 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 插件。