我正在尝试创建一个OSGi包并将其集成到eclipse中。我使用maven-pax-plugin来创建包。以下是我遵循的步骤
我使用pax创建了一个osgi项目
mvn org.ops4j:maven-pax-plugin:create-project -DgroupId=org.sonatype.mcookbook -DartifactId=osgi-project -Dversion=1.0-SNAPSHOT然后创建一个包
mvn pax:create-bundle -Dpackage=org.sonatype.mcookbook -Dname=osgi-bundle -Dversion=1.0-SNAPSHOT然后尝试将maven项目导入到eclipse (文件/导入/现有的maven项目)中,在第二步中创建的bundle项目总是会给出这个错误。
maven-pax-plugin:1.5:compile (1 error)
Execution default-compile, in org.sonatype.mcookbook/pom.xml
maven-pax-plugin:1.5:testCompile (1 error)
Execution default-testCompile, in org.sonatype.mcookbook/pom.xml当我选择其中一个错误时,描述显示
No marketplace entries found to handle Execution default-compile, in org.sonatype.mcookbook/pom.xml in Eclipse. Please see Help for more information.如果我忽略错误并导入项目,这就是eclipse所抱怨的。
Plugin execution not covered by lifecycle configuration: org.ops4j:maven-pax-plugin:1.5:compile (execution: default-compile, phase: compile)有没有人看过这个?有什么办法解决这个问题吗?我遵循this tutorial,但是添加了与eclipse的集成。但是请注意,如果我用maven构建它,而根本不使用eclipse,那么问题就出在eclipse/m2e上。
我使用的是Eclipse Indigo SR2和m2e 1.0.200
发布于 2012-07-13 18:16:15
新的m2eclipse版本要求使用m2eclipse插件来支持每个影响构建的插件。所以现在还不支持maven-pax-plugin。由于大多数maven插件基本上都会发生这种情况,所以我仍然使用旧的m2eclipse版本。不幸的是,旧的0.12版本的下载最近似乎被删除了。所以你可能要等到maven-pax-plugin被支持了。
发布于 2012-07-23 17:33:42
我通过遵循生成的POM中的注释来解决这个问题,并将<extensions>true</extensions>下移到下面的maven-bundle-plugin中,给出了:
...
<plugins>
<plugin>
<groupId>org.ops4j</groupId>
<artifactId>maven-pax-plugin</artifactId>
<version>1.4</version>
<!--
| enable improved OSGi compilation support for the bundle life-cycle.
| to switch back to the standard bundle life-cycle, move this setting
| down to the maven-bundle-plugin section
-->
<!-- WAS HERE -->
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.3</version>
<!--
| the following instructions build a simple set of public/private
| classes into an OSGi bundle
-->
<extensions>true</extensions> <!-- MOVED HERE :-) -->
<configuration>
...然后更新项目(在项目浏览器中右键单击项目名称: Maven ->更新项目...),等待构建完成,错误就消失了。
希望这能有所帮助!
https://stackoverflow.com/questions/11457829
复制相似问题