如何使用Maven和Tycho创建Eclipse插件版本? [英] How do I create an Eclipse plugin release using Maven and Tycho?

查看:345
本文介绍了如何使用Maven和Tycho创建Eclipse插件版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个Eclipse项目,该项目由许多打包在一起的插件组成.我为每个组件创建了POM文件,并为项目创建了一个主POM.像这样:

I am building an Eclipse project that consists of a number of plug-ins that are packed together. I have create POM files for each component and a main POM for the project. Something like this:

projectDir\releng\pom.xml <-- Parent project
projectDir\proj1\pom.xml  <-- Child project 1
projectDir\proj2\pom.xml  <-- Child project 2

我的构建当前可以通过调用构建所有内容的父POM来工作.到目前为止,我一直使用0.0.1-SNAPSHOT作为父POM的版本进行构建,并且在每个Eclipse插件中,我都将0.0.1.qualifier作为MANIFEST.MF文件中的版本.

My build currently works by calling the parent POM which builds everything. Until now I have been building using 0.0.1-SNAPSHOT as the version of the parent POM, and in each Eclipse plug-in I have 0.0.1.qualifier as the version in the MANIFEST.MF file.

我现在想将我的最新版本升级到0.1.0.根据我的理解,这意味着我必须遍历所有POM文件和MANIFEST.MF文件并升级两个文件中的版本(由于版本是在父POM中定义的,因此在所有子POM中都引用了该版本: s).

I now want to promote my latest version to 0.1.0. From my understanding, this means that I have to go over ALL of my POM files AND MANIFEST.MF files and upgrade the version in both of them (since while the version is defined in the parent POM, it is referenced in all child POM:s).

这是执行此操作的正确方法,还是有一种使整个过程自动化且不会出错的方法?

Is this the correct way to do this or is there a way to automate the whole process and not make mistakes?

P.S.有 Maven Release插件,但这不适用于Eclipse.

P.S. There is the Maven Release plugin but this won't work with Eclipse.

推荐答案

对于发布过程的版本更新步骤,有一个

For the version update step of a relase process, there is the tycho-versions-plugin which knows how to consistently update the POMs and manifests.

只需转到父级/聚合器模块的根目录并调用

Just go to the root of your parent/aggregator module and call

mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion="0.1.0"

这将使用与父项目相同/等效的版本更新父项目和所有子项目的版本.在您的情况下,这些都是项目,因为Eclipse版本0.0.1.qualifier被认为与Tycho中的0.0.1-SNAPSHOT等效.

This will update the version of the parent project and of all child projects with the same/equivalent version as the parent project. In your case, these are all projects because the Eclipse versions 0.0.1.qualifier is considerered equivalent to 0.0.1-SNAPSHOT in Tycho.

对于发布过程的其余步骤(标记,构建,推送标记等),只需调用相应的SCM或Maven命令即可,例如从脚本.我没有尝试为此使用maven-release-plugin(和显然没有其他人).

For the remaining steps of the release process (tagging, building, pushing tags, etc.) just call the appropriate SCM or Maven commands, e.g. from a script. I haven't tried to use the maven-release-plugin for this (and apparently no-one else has).

这篇关于如何使用Maven和Tycho创建Eclipse插件版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆