我使用tycho-packaging-plugin来设置jar的输出文件夹。这是我的pom缩短版本:
<properties>
<tycho-version>0.21.0</tycho-version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<configuration>
<buildDirectory>${project.build.directory}/plugins</buildDirectory>
</configuration>
</plugin>
</plugins>
</build>
如果我执行maven-install,我会收到警告:
[WARNING] Some problems were encountered while building the effective model for com.foo.bar.devtool:com.foo.bar.devtool:eclipse-plugin:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.eclipse.tycho:tycho-packaging-plugin is missing. @ line 44, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
我遵循警告的建议并修改pom:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<buildDirectory>${project.build.directory}/plugins</buildDirectory>
</configuration>
</plugin>
然后我在保存文件后出错:
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.eclipse.tycho:tycho-packaging-plugin:${tycho.version}:build-qualifier (execution: default-build-qualifier, phase:
validate)
- Plugin execution not covered by lifecycle configuration: org.eclipse.tycho:tycho-packaging-plugin:${tycho.version}:validate-version (execution: default-validate-version,
phase: validate)
- Plugin execution not covered by lifecycle configuration: org.eclipse.tycho:tycho-packaging-plugin:${tycho.version}:validate-id (execution: default-validate-id, phase: validate)
如何解决问题并避免同时收到警告和错误?
答案 0 :(得分:10)
您没有安装适用于m2e的Tycho Project Configorator,因此m2e不知道它是否应该执行列出的目标作为Eclipse中增量构建的一部分。
要安装连接器,请触发错误的快速修复(例如,从“问题”视图中),然后选择发现新的m2e连接器。
答案 1 :(得分:1)
我喜欢简单地让它消失了#39;打开 Preferences
&gt; Maven
&gt; Errors/Warnings
并更改&#39; Plugin execution not covered by lifecycle configuration
&#39;的行为设置到&#39; Ignore
&#39;。根本没有解决问题,但肯定会避免警告和错误。