开发者

How to keep plug-in manifest version and pom version in sync in Maven with Tycho

I am using Maven with Tycho to build an eclipse plugin. Tycho generat开发者_Python百科es the pom.xml file for Maven by inspecting the manifest file of the plugin. Now both the manifest file and the pom file have the version of the plugin and they need to be kept in sync manually. This is because I have done some customization in the generated pom file and cannot overwrite it every time I change the version in the manifest.

My question here is, is there a way to keep these versions in sync automatically using Tycho?


It seems you can update versions using the tycho-versions-plugin (using tycho 0.14.0 here):

mvn -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=NEW_VERSION-SNAPSHOT

This updates POMs, MANIFESTs and feature.xml


Right now you have to keep them in sync manually. There is an open issue - TYCHO-214: OSGi release procedures and best practices - which should cover this. It's currently targeted for 0.9.0 - the next version.


We had a similar situation. We were tired of changing the version in the Manifest and in the pom.xml. But changing the version with maven wasn't a good solution, because of running a special maven-command everytime were no solution for us.

But I found a Tychoplugin which we integrated in out build.

    <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-versions-plugin</artifactId>
        <version>${tycho.version}</version>
        <executions>
            <execution>
                <id>versions</id>
                <phase>validate</phase>
                <goals>
                    <goal>update-pom</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

This plugin updates the version in the pom.xml with the version of the Manifest every Build automatically.

More information at https://www.eclipse.org/tycho/sitedocs/tycho-release/tycho-versions-plugin/plugin-info.html


It's rather handy to use Version Tiger plugin for Eclipse. This plugin adds a context menu to eclipse which allows you to update OSGI and pom versions simultaniously.

Version Tiger can be downloaded here: https://github.com/inventage/version-tiger

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜