And*_*ite 871 eclipse m2eclipse maven spring-data
我正在尝试使用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>
Run Code Online (Sandbox Code Playgroud)
我看到的错误是:
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)
Run Code Online (Sandbox Code Playgroud)
我正在运行Eclipse 3.6.2和m2e 0.13.我不是Maven专家,所以如果可能的话,请在答案中说明一点.
Sim*_*zon 1277
在我遇到类似问题的情况下,不是使用Andrew的修复建议,而是在我将<pluginManagement>标签引入到有问题的pom.xml之后.看起来该错误是由于缺少<pluginManagement>标记造成的.因此,为了避免Eclipse中的异常,需要简单地将所有插件标记括在<pluginManagement>标记内,如下所示:
<build>
<pluginManagement>
<plugins>
<plugin> ... </plugin>
<plugin> ... </plugin>
....
</plugins>
</pluginManagement>
</build>
Run Code Online (Sandbox Code Playgroud)
一旦这个结构到位,错误就会消失.
And*_*ite 407
真是一团糟.我不记得我在哪里找到了这个,但我必须添加以下内容才能让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>
Run Code Online (Sandbox Code Playgroud)
M2Eclipse插件存在许多其他问题,这些问题根本无法与Spring Data一起使用.最后,我禁用了M2Eclipse,转而支持Apache Eclipse插件.
Ved*_*ran 206
解决这个问题的最快方法是(来自Eclipse m2e文档):
使用快速修复pom.xml中的错误并选择Permanently mark goal run in pom.xml as ignored in Eclipse build
- 这将为您生成所需的样板代码.
之后,只需在生成的配置<ignore/>
中用<execute/>
标签替换标签,您就完成了:
<action>
<execute/>
</action>
Run Code Online (Sandbox Code Playgroud)小智 203
在Eclipse Luna 4.4.0中,您可以选择忽略首选项中的此错误
窗口 > 首选项 > Maven > 错误/警告 > 生命周期配置未涵盖插件执行.根据需要选择忽略/警告/错误.
此外,在此错误的快速修复(Ctrl + 1)中,它提供了一个选项,在Eclipse首选项中的Eclipse构建中将目标标记为已忽略(实验性)
这是一种更干净的方式,因为它不会修改你的pom.xml
.
您将需要执行Maven > Update项目以在任何其他项目中修复相同的错误.
在STS(Spring-tool-suite)中,您可以选择忽略首选项中的此错误
窗口>首选项> Maven>错误/警告>生命周期配置未涵盖插件执行.根据需要选择忽略/警告/错误.然后.右键单击项目单击Maven并更新项目,然后错误将消失.
Tho*_*yer 110
请参阅https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html.
为解决一些长期存在的问题,m2e 1.0需要明确说明如何处理绑定到项目构建生命周期"有趣"阶段的所有Maven插件.我们将这些指令称为"项目构建生命周期映射"或简称为"生命周期映射",因为它们定义m2e如何将项目pom.xml文件中的信息映射到Eclipse工作区项目配置和Eclipse工作区构建期间的行为.
项目构建生命周期映射配置可以在项目pom.xml中指定,由Eclipse插件提供,并且还有m2e附带的一些常用Maven插件的默认配置.我们将这些称为"生命周期映射元数据源".m2e将为所有在任何映射元数据源中没有生命周期映射的插件执行创建如下所示的错误标记.
Run Code Online (Sandbox Code Playgroud)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使用插件groupId,artifactId,版本范围和目标的组合将插件执行与动作相匹配.有两个基本操作可以指示m2e执行插件执行 - 忽略,执行和委托给项目配置器.
noi*_*rre 30
m2e 0.13引入了m2e连接器和m2e市场,以扩展m2e功能.它就像旧的m2e-extras存储库.
您可以从首选项访问m2e市场:首选项> Maven>发现>打开目录.安装WTP集成为我解决了大多数插件问题.
kvm*_*006 25
将插件执行的Maven首选项从错误更改为忽略
Dav*_*vid 23
请注意,今天的Eclipse Neon版本系列中提供的M2Eclipse(m2e)版本1.7.0支持用于指定生命周期映射元数据的新语法.结果像这样的样板(这里我们告诉m2e忽略目标):
<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>exec-maven-plugin</artifactId>
<versionRange>[1.5.0,)</versionRange>
<goals>
<goal>exec</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Run Code Online (Sandbox Code Playgroud)
可以在插件的执行节点中用一行替换:
<?m2e ignore?>
Run Code Online (Sandbox Code Playgroud)
有关详细信息,请参阅发行说明
hto*_*ins 21
作为之前答案的补充 - 如果您不能或不想将所有这些样板添加到项目POM中,我会发现一种解决方法.如果您查看以下位置:
{Eclipse_folder}/plugins/org.eclipse.m2e.lifecyclemapping.defaults_{m2e_version}
Run Code Online (Sandbox Code Playgroud)
您应该找到一个名为的文件lifecycle-mapping-metadata.xml
,您可以在其中进行其他答案中描述的相同更改以及未涵盖的M2E插件执行.
Kri*_*aan 17
Eclipse v3.7(Indigo)和m2eclipse作为我的Maven插件遇到了同样的问题.通过在插件定义中明确说明执行阶段,可以轻松解决错误.所以我的pom看起来像这样:
<project>
...
<build>
...
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<timestampFormat>yyyy-MM-dd_HH-mm-ss</timestampFormat>
</configuration>
<executions>
<execution>
*<phase>post-clean</phase>*
<goals>
<goal>create-timestamp</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
...
Run Code Online (Sandbox Code Playgroud)
Hen*_*wan 10
使用此软件存储库
确保选中"在安装期间联系所有更新站点以查找所需的软件".
安装AJDT m2e配置器
来源:升级SpringSource Tool Suite 2.8.0的Maven集成(Andrew Eisenberg)
如果您没有安装ADJT,它应自动安装,但如果没有安装,则首先从"Indigo更新站点"(根据您的Eclipse版本)安装AspectJ开发工具(ADJT).
有关AspectJ Development Tools站点的更多信息.
转到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工作区生命周期映射元数据!).这是基于的例子eclipse/plugins/org.eclipse.m2e.lifecyclemapping.defaults_1.2.0.20120903-1050.jar/lifecycle-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>
Run Code Online (Sandbox Code Playgroud)
我在SpringSource Tool Suite 2.8.0的博客文章升级Maven集成之后修复了它.
按照" 噢......我的项目不再构建 " 一节中的建议进行操作.即使它是用于SpringSource Tool Suite,我也用它来修复常规的Eclipse安装.我没有必要修改我的pom文件.
归档时间: |
|
查看次数: |
940616 次 |
最近记录: |