【发布时间】:2013-05-29 09:07:29
【问题描述】:
在我的 Eclipse 工作区中,在 java 编辑器中保存文件会使 m2e 在项目上运行 defaultGoal(安装),这涉及重写 MANIFEST.MF 文件。因为我正在使用另一个没有 m2e 连接器的插件 (maven-scr-plugin),这使得我的清单文件无用。
我想做的是防止 maven-bundle-plugin 在保存时执行,到目前为止我提出了两种可能的解决方案:
您可以编辑 Eclipse 生命周期映射,但出于某种原因,这并不能解决问题(我认为应该这样做):
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<versionRange>[0.0,)</versionRange>
<goals>
<goal>instructions</goal>
<goal>bundle</goal>
<goal>manifest</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
或者,将我的 pom.xml 中的 <build> 中的 defaultGoal 更改为 compile 也意味着无法到达捆绑插件启动的地步,但我真的不想更改我的 pom,因为日食特性。
有没有办法为 m2e 插件定义一个 defaultGoal?你们有没有其他的方法来解决这个问题?谢谢!
【问题讨论】:
标签: java eclipse maven m2e maven-bundle-plugin