Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Combine tycho-versions-plugin with tycho-buildtimestamp-jgit

Generally, I strongly advice against using different version formats for
release and snapshot builds. It is okay to add qualifier suffix, like
you appear to do, but anything else makes release and snapshot version
not comparable and breaks upgrade scenarios between snapshot and release

Having said that, it is possible to control format of version qualifier
generated by tycho-packaging-plugin using <format> plugin configuration
parameter. It takes java SimpleDateFormat string (default is
yyyyMMddHHmm) so you can add ${milestone.version} there if you really want.

I don't deploy Tycho artifacts to Maven repositories so I have no
experience in this area. I think what you want requires changes to
tycho-versions-plugin, new mojo that will generate versions based on
project's configured timestamp provider. Should be relatively
straightforward to implement and I can give you some pointers where to
start on tycho-dev if you want to try.


On 2014-02-28, 4:37, Ken Lee wrote:
Here's a concrete example of my problem:

In our file a bundle has the following defined:
Bundle-Version: 4.0.0.qualifier In the according pom.xml we define:
<version>4.0.0-SNAPSHOT</version> We also use the
tycho-buildtimestamp-jgit plugin. This result in something like
org.example.bundle_4.0.0.20140228-1000.jar when building a snapshot
build, where 20140228-1000 is the timestamp of the last Git commit.
If we deploy that artifact to our Maven repo, this artifact is
considered to be a SNAPSHOT artifact.

For a release build I'd like the resulting bundle to look something
like org.example.bundle_4.0.0.20140228-1000-M6.jar. My approach was
to use the tycho-versions-plugin to set the explicit version in the
manifest and pom files by passing the format
(base.version=4.0.0 / milestone.version=M6) as the newVersion
parameter. However, for the middle part ${} I'd
like to have the Git commit timestamp rather than the build
timestamp. That's why I was thinking of combining the
tycho-buildtimestamp-jgit together with the tycho-versions-plugin.

I heard about the property forceContextQualifier which would probably
result in the correct version qualifier. However, if the artifact is
deployed to the Maven repo it would still be considered as a SNAPSHOT
build, wouldn't it?

-----Original Message-----
From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of Igor Fedorenko
Sent: Donnerstag, 27. Februar 2014 18:27
To: tycho-user@xxxxxxxxxxx
Subject: Re: [tycho-user] Combine tycho-versions-plugin with tycho-buildtimestamp-jgit

Not sure I understand. Why not just use tycho-buildtimestamp-jgit and let it generate version qualifier?


On 2014-02-27, 12:15, Ken Lee wrote:
Hi all,

I'm wondering if it's somehow possible to combine the
tycho-version-plugin with tycho-buildtimestamp-jgit.

For our release builds, I'd like to append a particular milestone
identifier after the build qualifier. So the parameter newVersion in
the tych-version-plugin becomes something like this:
${base.version}.${}-${milestone.version}, e.g.

However, instead of using the build timestamp I'd like to use the Git
commit timestamp that is calculated by the tycho-buildtimestamp-jgit plugin.

Any ideas how these plugins could work together?

Thanks in advance.



tycho-user mailing list

tycho-user mailing list

tycho-user mailing list

Back to the top