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

4

14

I am using Maven with Tycho to build an eclipse plugin. Tycho generates 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?

Greengrocery answered 17/5, 2010 at 11:43 Comment(0)
C
19

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

Croak answered 15/2, 2012 at 13:30 Comment(2)
I tried this and got: [ERROR] Unknown lifecycle phase ".mode=maven". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<...Overmaster
Worked well with 0.18.1. I only needed to change site\category.xmlShelbashelbi
I
3

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.

Incoercible answered 28/5, 2010 at 6:26 Comment(0)
F
2

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

Flite answered 3/9, 2014 at 12:50 Comment(0)
W
1

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

Whiggism answered 16/9, 2015 at 7:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.