Ral*_*lph 56 java eclipse m2eclipse maven m2e
为了使m2e 1.0正常工作,我必须指定生命周期映射:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<versionRange>[2.0.2,)</versionRange>
<goals>
<goal>process</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Run Code Online (Sandbox Code Playgroud)
但后来我收到了这个警告:
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
Run Code Online (Sandbox Code Playgroud)
如果我运行一些特定的maven任务例如mvn clean install findbugs:findbugs(如果我只运行mvn clean install那么没有这样的消息)
我知道问题是这个POM不存在,因为它只被定义为保存映射信息.(m2e生命周期映射未找到)
无论如何,我想保持我的构建清洁,没有任何警告,所以我怎么能摆脱这个具体的?(我的CI服务器检查没有警告.)
我使用Maven 3.0.2并尝试了Maven 3.0.3,但结果相同.
ctr*_*den 64
我的团队通过在配置文件中包含相关配置来解决此问题:
<profile>
<id>only-eclipse</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
...
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
Run Code Online (Sandbox Code Playgroud)
all*_*rog 17
这是一个已知的bug与WONTFIX分辨率.在我看来,建议的解决方案是最简单的:
mvn archetype:generate -DgroupId=org.eclipse.m2e -DartifactId=lifecycle-mapping \
-Dversion=1.0.0 -DarchetypeArtifactId=maven-archetype-mojo
Run Code Online (Sandbox Code Playgroud)
和install这个项目.
小智 8
此解决方案现已弃用,我建议使用@ctrueden的"配置文件"解决方案,这是可接受的答案!
虽然不是最干净的解决方案,但是当您在公司中使用存储库管理器或者您自己时,您可以这样做: - Checkout https://github.com/mfriedenhagen/dummy-lifecycle-mapping-plugin.- 独立运行mvn install- mvn deploy -DaltDeploymentRepository=REPO_ID::default::YOUR_THIRDPARTY_REPO_URL当您拥有像Nexus或Artifactory这样的存储库管理器时运行.- 请参阅https://github.com/mfriedenhagen/dummy-lifecycle-mapping-plugin/blob/master/README.creole.
关心Mirko
m2eclipse 1.7.0引入了一种替代方法,即XML处理指令。
在最初的例子,您只需将“注解”每次<execution>的maven-processor-plugin的process目标与
<?m2e execute?>
Run Code Online (Sandbox Code Playgroud)
有关语法和其他选项的更多详细信息,请参见发行说明。
| 归档时间: |
|
| 查看次数: |
39516 次 |
| 最近记录: |