Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cbi-dev] A Mojo to validate version consistency

Hi all,

For JBoss Tools, as we work on different streams, we often forget to update the version on the "master" stream, so that we end up with some latest snapshots whose version is inferior to the one of the latest release (from a maintenance stream). We used to catch it late in the release process, when there are deadline and it's much more difficult to fix it.
Other projects we contribute to, such as Eclipse Platform ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=443353 ) or WebTools ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=457292 ) also have the same issue from time to time.

We've implemented a Mojo, that hooks on the verify phase of any Maven artifact creating p2 IUs using Tycho (eclipse-plugin, eclipse-feature, eclipse-repository), which takes as input a "baseline" -usually the last released p2 repository- and that compares the version of artifacts produced by the build with the one in the baseline, and would fail with an explicit message when a version is wrong.
Definition of wrong:
* build version strictly inferior to version found in baseline
* version equals with the one in baseline, but *with different content*. (so reproducible builds as documented in https://wiki.eclipse.org/Tycho/Reproducible_Version_Qualifiers would still work)
* same x.y.z but with different qualifier.
With those rules, you immediately notice as a Build Error when an artifact has not been upversioned.

For JBoss Tools, it did catch several errors as soon as we did set up the mojo ( https://github.com/jbosstools/jbosstools-build/commit/492e584c817683ad7121627a3e6af39f2b9d5b3e ) , and we are already very happy with it since errors are fixed with a regular change, instead of having to be fixed later, maybe even requiring us to respin some builds.
I believe it provides good value to any project built with Tycho. So we'd like to contribute it upstream. I believe the best location for such mojo would be to have it in tycho-extras (or tycho "regular"). Would such a contribution be welcome there?

The Mojo is here: https://github.com/jbosstools/jbosstools-maven-plugins/blob/master/tycho-plugins/repository-utils/src/main/java/org/jboss/tools/tycho/sitegenerator/CompareWithBaselineMojo.java

Cheers,
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat
My blog - My Tweets

Back to the top