简体   繁体   English

Maven Tycho与Eclipse PDE Tools相比在导出RCP方面的​​优势

[英]Advantages of Maven Tycho over Eclipse PDE Tools for exporting RCP

In the light of some recent issues regarding JavaFX and exporting an Eclipse RCP application, I'm considering abandoning the Eclipse PDE exporter, and switching to a Tycho build. 鉴于最近有关JavaFX和导出Eclipse RCP应用程序的一些问题,我正在考虑放弃Eclipse PDE导出器,并切换到Tycho构建。

  1. Which approach is simpler, and which is over-complicated? 哪种方法更简单,哪种方法过于复杂? Do I need to constantly tweak the Tycho build configuration? 我需要不断调整Tycho构建配置吗?

  2. Current project is already using ant scripts to build a core EAR. 当前项目已经在使用蚂蚁脚本来构建核心EAR。 Should that be built with Maven to be consistent? 是否应该使用Maven构建一致的文件?

  3. I'm aware of some issues between Maven and Eclipse Plug-ins. 我知道Maven和Eclipse插件之间存在一些问题。 Is there anything critical I should be worried about? 有什么重要的我应该担心的吗?

I'm in heavy R&D mode. 我处于繁重的研发模式。

Also, I don't consider this to be opinion-based, rather a topic asking for strong arguments in favour of each one of these two. 另外,我不认为这是基于观点的,而是一个主题,要求有力的论据来支持这两个主题。

I wouldn't say one of them is much simpler then the other. 我不会说其中一个比另一个简单得多。 Most often Tycho is preferred since Maven is de facto an industry standard for builds. 大多数情况下,首选Tycho,因为Maven 实际上是构建的行业标准。 As such Maven skills are more common. 因此,Maven技能更为普遍。 This also allows you to build an RCP product like any other application using Maven. 这也使您可以像使用Maven的任何其他应用程序一样构建RCP产品。

In Maven/Tycho both the pom.xml and the OSGi manifest include dependency information so there's a bit of redundancy. 在Maven / Tycho中,pom.xml和OSGi清单均包含依赖项信息,因此存在一些冗余。 The idea is to have one of these files be the master version. 想法是让这些文件之一成为主版本。 If you choose OSGi files to be master then resulting approach is called manifest-first. 如果选择OSGi文件作为主文件,则生成的方法称为清单优先。 Choose otherwise and you end up with POM-first. 否则,您将得到POM-first。

I'm using manifest-first and my POM files for plugins look like this: 我使用清单优先,插件的POM文件如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
      <groupId>aerie-sdk</groupId>
      <artifactId>aerie-sdk</artifactId>
      <version>3.0.5-SNAPSHOT</version>
      <relativePath>../pom.xml</relativePath>
   </parent>
   <groupId>aerie-sdk</groupId>
   <artifactId>com.example.aerie.ui</artifactId>
   <version>2.5.5-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
</project>

I only need to bump versions in POM files to match the ones in manifest files. 我只需要修改POM文件中的版本以匹配清单文件中的版本。

Answers: 回答:

  1. I'd say the one you're more familiar with is simpler. 我想说的是您更熟悉的一种比较简单。 If you're new to Maven but have some experience with PDE build then Maven is harder. 如果您是Maven的新手,但有一定的PDE构建经验,那么Maven会更难。 For Maven POM-first there's a need to tweak POM files quite often. 对于Maven-POM-first,需要经常调整POM文件。 If you choose manifest-first then POMs are not modified that frequently (and changes are simpler - mostly version changes). 如果选择“清单优先”,则POM不会被频繁修改(并且更改更为简单-主要是版本更改)。

  2. You can run Ant from Maven, no need to convert. 您可以从Maven运行Ant,而无需进行转换。

  3. Not really. 并不是的。 If you hit any bumps there's a lot of information on Eclipse community forums, stackoverflow or similar sites. 如果遇到任何困难,Eclipse社区论坛,stackoverflow或类似站点上都有很多信息。

I'm not sure your comparison makes sense at all. 我不确定您的比较是否有意义。 The Eclipse PDE exporter is an interactive tool, and as such cannot be used for an automated build. Eclipse PDE导出器是一个交互式工具,因此不能用于自动构建。 So if you need an automated build, you will have move to something else, eg Tycho. 因此,如果您需要自动构建,则可以使用其他软件,例如Tycho。

Tycho is a Maven build extension which aims to make it easy to set up an automated build for projects developed with the Eclipse PDE. Tycho是Maven构建扩展,旨在简化使用Eclipse PDE开发的项目的自动构建。 It re-uses the configuration files that you already have (MANIFEST.MF, feature.xml, *.product), so the additional configuration files needed for Tycho (pom.xml) are pretty minimal and rarely need to be updated. 它会重用您已经拥有的配置文件(MANIFEST.MF,feature.xml,*。product),因此Tycho(pom.xml)所需的其他配置文件非常少,几乎不需要更新。

The only piece of information which is redundant in the pom.xml file is the artifact version. pom.xml文件中唯一冗余的信息是工件版本。 To support you when updating artifact versions, there is a command-line tool: the tycho-versions-plugin . 为了在更新工件版本时为您提供支持,有一个命令行工具: tycho-versions-plugin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM