Question

I have an Eclipse 4 project that is built using Tycho (0.19.0) and Maven (3.0-5)

During development of a version, say 1.0.0, the artifacts are configured with version 1.0.0-SNAPSHOT, and 1.0.0.qualifier depending on the files. When I want to release the version, I use the tycho-versions:set-version goal to change from 1.0.0-SNAPSHOT to 1.0.0.

I then build and copy the product to a remote share that publishes an update site so that older versions can be upgraded automatically at launch time.

Since I have some beta testers, I use more that one update site. One contains the stable versions, and my beta testers have one more update site to check at startup. The other one is actually an update site for snapshots that I have published, so those are not released versions of the product.

What I am experiencing seems strange: When the 1.0.0 application starts, it finds the previous snapshot (versioned 1.0.0.201312191455), thinks that those artifacts are more recent and updates itself back to an older version.

I'm guessing that Eclipse's version conventions state that x.y.z is older than x.y.z.u. Is that correct?

If so, then why does the tycho versions plugin remove the qualifier when a versions changes from snapshot to "release"? Doing so seems to make the artifacts look older than any of the snapshots. What's the correct way to handle this situation?

Was it helpful?

Solution

The answer was given in the tycho mailing list some time ago:

http://dev.eclipse.org/mhonarc/lists/tycho-user/msg01001.html

The details:

OSGi does not have a notion of "snapshot" versions, all versions are treated the same and 1.0.0.qualifier is indeed considered to be newer than 1.0.0.

There are two versioning schemes that result is reasonable behaviour both for OSGi and Maven.

Use the same four part version (eg., 1.0.0.20111112-0735) for both Maven and OSGi. This results in slightly odd version jump when going from snapshots to releases on the maven side, i.e. 1.0.0-SNAPSHOT goes to 1.0.0.20111112-0735, but everything works otherwise.

Use even/odd convention to version snapshots and releases, i.e. 1.0.1-SNAPSHOT/1.0.1.qualifier is released as 1.0.2/1.0.2.

I think it is also possible to decouple maven and osgi versions of released artifacts, i.e. use 1.0.0 for maven and 1.0.0.20111112-0735 for OSGi, but personally I find this confusing and would not recommend. And I am not sure if Tycho will allow this in the future.

-- Regards, Igor

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top