目前是否可以通过Maven构建Eclipse插件并具有良好的IDE集成?

时间:2023-01-12 13:58:08

I'm currently evaluating maven to improve our build process. The building and creating of normal jar files works so far, although I'm not entirely happy with the Maven IDE.

我目前正在评估maven以改进我们的构建过程。到目前为止,构建和创建普通jar文件仍然有效,尽管我对Maven IDE并不满意。

I'm now at that point, where all libs I need for our project are built, and I'm moving on to the Eclipse RCP projects. And now I'm not sure how to go on.

我现在正处于构建项目所需的所有库中,并且我正在转向Eclipse RCP项目。而现在我不知道该怎么做。

There are some plugins I need to build first, before moving on to the actual RCP part. Therefore I have actually 3 problems.

在进入实际的RCP部分之前,我需要首先构建一些插件。因此我实际上有3个问题。

I want to build those plugins, the only real solution for that seems to be the maven-bundle-plugin: http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

我想构建这些插件,唯一真正的解决方案似乎是maven-bundle-plugin:http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

But, For nice IDE integration I also need the appropriate files (plugin.xml, build.properties, etc ...) which should be generated automatically.

但是,对于良好的IDE集成,我还需要适当的文件(plugin.xml,build.properties等...),这些文件应该自动生成。

For building the RCP parts, it seems so far the only solution is only the pde-maven-plugin http://mojo.codehaus.org/pde-maven-plugin/ which, as far as I can tell, uses ant-pde. This is stupid, isn't it?

为了构建RCP部件,似乎到目前为止唯一的解决方案只是pde-maven-plugin http://mojo.codehaus.org/pde-maven-plugin/,据我所知,它使用了ant-pde 。这是愚蠢的,不是吗?

The only other thing I could found was tycho (http://www.sonatype.com/people/2008/11/building-eclipse-plugins-with-maven-tycho/) , but this is till in a very early stage.

我唯一能找到的东西是tycho(http://www.sonatype.com/people/2008/11/building-eclipse-plugins-with-maven-tycho/),但这是在很早的阶段。

and again, a nice Eclipse integration is necessary. I really, really, really don't want to specify dependencies twice.

再次,一个很好的Eclipse集成是必要的。我真的,真的,真的不想两次指定依赖项。

So How do you build your Eclipse RCP projects with maven?

那么如何使用maven构建Eclipse RCP项目?

Update

For now, it seems that there is no such solution available. Tycho looks very promising, but I wasted 2 days and didn't get it to run (the current version at this point). Maybe it will be ready in half a year or so.

目前,似乎没有这样的解决方案。 Tycho看起来非常有前途,但我浪费了2天而没有让它运行(此时的当前版本)。也许它会在半年左右的时间内准备就绪。

8 个解决方案

#1


No there is no such tool. Tycho is also the only approach I know of.

没有这样的工具。第谷也是我所知道的唯一方法。

#2


I use m2eclipse and it fits well my needs. You specify your dependencies in the pom.xml and they are automatically taken into account in Eclipse's build path.

我使用m2eclipse,它很符合我的需求。您可以在pom.xml中指定依赖项,并在Eclipse的构建路径中自动考虑它们。

Caveat: I cannot tell anything about RCP (never built anything for that platform).

警告:我无法告诉RCP(从未为该平台构建任何东西)。

Best regards,

Cyril

#3


Are you dead set on using maven to build your RCP apps? I ask this because, from my experience using maven to build anything more than trivial RCP apps can be quite a pain. When I started working on RCP applications I initially investigated using maven as a build solution, but found out that the support for eclipse builds within maven was very basic at the time. Also, some co-workers of mine are using maven for another RCP based project in our company, and while the support for eclipse has gotten better, they had to jump through some hoops to get it to work to their liking. So, my opinion is that for now, stick to using the ant based pde build for your RCP applications.

您是否已经开始使用maven来构建您的RCP应用程序?我问这个是因为,根据我使用maven构建任何东西而不仅仅是琐碎的RCP应用程序的经验可能会非常痛苦。当我开始研究RCP应用程序时,我最初使用maven作为构建解决方案进行了调查,但发现在maven中对eclipse构建的支持在当时非常基础。此外,我的一些同事正在使用maven为我们公司的另一个基于RCP的项目,虽然对eclipse的支持已经变得更好,但他们必须跳过一些环节才能让它按照自己的喜好工作。所以,我的观点是,现在,坚持使用基于ant的pde构建为您的RCP应用程序。

#4


Nowadays Tycho allows resolving dependencies based on the built bundles' manifests (required bundles, imported packages, etc.).

如今,Tycho允许根据构建的bundle的清单(必需的bundle,导入的包等)解析依赖关系。

Moreover, Tycho can be configured to use a target platform for the build. This allows using the same target platform for maven and pde builds.

此外,Tycho可以配置为使用目标平台进行构建。这允许使用相同的目标平台进行maven和pde构建。

Since v0.24.0, Tycho can even build POM-less plug-ins and features, avoiding the duplication of version and artifactId metadata.

从v0.24.0开始,Tycho甚至可以构建无POM的插件和功能,避免了版本和artifactId元数据的重复。

In light of the above, and considering that even the Eclipse Platform is built using it for a few years now, Maven Tycho is currently the best way to build an RCP headlessly.

鉴于上述情况,并考虑到即使Eclipse平台使用它已经使用了几年,Maven Tycho目前是无头地构建RCP的最佳方式。

#5


In our project we have separated the target platform and the application plugins. In short: we build the target platform with Maven, while the application plugins are built with PDE.

在我们的项目中,我们将目标平台和应用程序插件分开。简而言之:我们使用Maven构建目标平台,而应用程序插件则使用PDE构建。

#6


I used Mavenide for a while, it was just ok. Not sure on how it is today though.

我使用了Mavenide一段时间,它还可以。不知道今天是怎么回事。

#7


Tycho does what you need. Now in 2012, it is mature and usable set of maven plugins. I can only recommend it.

第谷做你需要的。现在在2012年,它是成熟且可用的maven插件集。我只能推荐它。

The quality of the documentation has obviously not changed very much since 2009. It may be difficult to get Tycho running. We managed to understand Tycho and we've been successfully using it for building a considerably large Eclipse RCP application for more than a year and a half. We adopted a manifest-first approach, where all the plugin(project) dependencies are defined in MANIFEST.MF. The final product of our build is an executable application and also a p2 site for easy updates. All done by maven build.

自2009年以来,文档的质量显然没有太大变化。可能很难让Tycho运行。我们成功地理解了Tycho,并且我们已经成功地使用它来构建一个相当大的Eclipse RCP应用程序超过一年半。我们采用了清单优先方法,其中所有插件(项目)依赖项都在MANIFEST.MF中定义。我们构建的最终产品是可执行应用程序,也是一个便于更新的p2站点。全部由maven构建完成。

#8


If u r building an Eclipse Plugin or application (RCP) Maven Tycho is the recommended way to build it.

如果您构建Eclipse插件或应用程序(RCP)Maven Tycho是构建它的推荐方法。

It's pretty intelligent in resolving osgi dependencies. U can refer to my tutorials on Maven Tycho Tutorials

它在解析osgi依赖项方面非常聪明。你可以参考我在Maven Tycho Tutorials上的教程

Maven Tycho requires m2eclipse and Tycho configurator installation.

Maven Tycho需要m2eclipse和Tycho配置器安装。

And archetype should be eclipse-plugin or eclipse-feature or eclipse-repository

原型应该是eclipse-plugin或eclipse-feature或eclipse-repository

#1


No there is no such tool. Tycho is also the only approach I know of.

没有这样的工具。第谷也是我所知道的唯一方法。

#2


I use m2eclipse and it fits well my needs. You specify your dependencies in the pom.xml and they are automatically taken into account in Eclipse's build path.

我使用m2eclipse,它很符合我的需求。您可以在pom.xml中指定依赖项,并在Eclipse的构建路径中自动考虑它们。

Caveat: I cannot tell anything about RCP (never built anything for that platform).

警告:我无法告诉RCP(从未为该平台构建任何东西)。

Best regards,

Cyril

#3


Are you dead set on using maven to build your RCP apps? I ask this because, from my experience using maven to build anything more than trivial RCP apps can be quite a pain. When I started working on RCP applications I initially investigated using maven as a build solution, but found out that the support for eclipse builds within maven was very basic at the time. Also, some co-workers of mine are using maven for another RCP based project in our company, and while the support for eclipse has gotten better, they had to jump through some hoops to get it to work to their liking. So, my opinion is that for now, stick to using the ant based pde build for your RCP applications.

您是否已经开始使用maven来构建您的RCP应用程序?我问这个是因为,根据我使用maven构建任何东西而不仅仅是琐碎的RCP应用程序的经验可能会非常痛苦。当我开始研究RCP应用程序时,我最初使用maven作为构建解决方案进行了调查,但发现在maven中对eclipse构建的支持在当时非常基础。此外,我的一些同事正在使用maven为我们公司的另一个基于RCP的项目,虽然对eclipse的支持已经变得更好,但他们必须跳过一些环节才能让它按照自己的喜好工作。所以,我的观点是,现在,坚持使用基于ant的pde构建为您的RCP应用程序。

#4


Nowadays Tycho allows resolving dependencies based on the built bundles' manifests (required bundles, imported packages, etc.).

如今,Tycho允许根据构建的bundle的清单(必需的bundle,导入的包等)解析依赖关系。

Moreover, Tycho can be configured to use a target platform for the build. This allows using the same target platform for maven and pde builds.

此外,Tycho可以配置为使用目标平台进行构建。这允许使用相同的目标平台进行maven和pde构建。

Since v0.24.0, Tycho can even build POM-less plug-ins and features, avoiding the duplication of version and artifactId metadata.

从v0.24.0开始,Tycho甚至可以构建无POM的插件和功能,避免了版本和artifactId元数据的重复。

In light of the above, and considering that even the Eclipse Platform is built using it for a few years now, Maven Tycho is currently the best way to build an RCP headlessly.

鉴于上述情况,并考虑到即使Eclipse平台使用它已经使用了几年,Maven Tycho目前是无头地构建RCP的最佳方式。

#5


In our project we have separated the target platform and the application plugins. In short: we build the target platform with Maven, while the application plugins are built with PDE.

在我们的项目中,我们将目标平台和应用程序插件分开。简而言之:我们使用Maven构建目标平台,而应用程序插件则使用PDE构建。

#6


I used Mavenide for a while, it was just ok. Not sure on how it is today though.

我使用了Mavenide一段时间,它还可以。不知道今天是怎么回事。

#7


Tycho does what you need. Now in 2012, it is mature and usable set of maven plugins. I can only recommend it.

第谷做你需要的。现在在2012年,它是成熟且可用的maven插件集。我只能推荐它。

The quality of the documentation has obviously not changed very much since 2009. It may be difficult to get Tycho running. We managed to understand Tycho and we've been successfully using it for building a considerably large Eclipse RCP application for more than a year and a half. We adopted a manifest-first approach, where all the plugin(project) dependencies are defined in MANIFEST.MF. The final product of our build is an executable application and also a p2 site for easy updates. All done by maven build.

自2009年以来,文档的质量显然没有太大变化。可能很难让Tycho运行。我们成功地理解了Tycho,并且我们已经成功地使用它来构建一个相当大的Eclipse RCP应用程序超过一年半。我们采用了清单优先方法,其中所有插件(项目)依赖项都在MANIFEST.MF中定义。我们构建的最终产品是可执行应用程序,也是一个便于更新的p2站点。全部由maven构建完成。

#8


If u r building an Eclipse Plugin or application (RCP) Maven Tycho is the recommended way to build it.

如果您构建Eclipse插件或应用程序(RCP)Maven Tycho是构建它的推荐方法。

It's pretty intelligent in resolving osgi dependencies. U can refer to my tutorials on Maven Tycho Tutorials

它在解析osgi依赖项方面非常聪明。你可以参考我在Maven Tycho Tutorials上的教程

Maven Tycho requires m2eclipse and Tycho configurator installation.

Maven Tycho需要m2eclipse和Tycho配置器安装。

And archetype should be eclipse-plugin or eclipse-feature or eclipse-repository

原型应该是eclipse-plugin或eclipse-feature或eclipse-repository