Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342893 - Support for release-process like Maven
Summary: Support for release-process like Maven
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement with 19 votes (vote)
Target Milestone: ---   Edit
Assignee: Jan Sievers CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, helpwanted
Depends on:
Blocks:
 
Reported: 2011-04-14 16:36 EDT by Alexander Fischer CLA
Modified: 2021-04-28 16:55 EDT (History)
29 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Fischer CLA 2011-04-14 16:36:10 EDT
With the maven-release-plugin you can go through a very complex workflow for artifacts.
With tycho I must do all steps by hand:
- checkout the plugins
- patching the manifests and poms (partially supported with the tycho-setversion-plugin)
- patching the .product-files, feature.xml and so on with the new version-numbers
- build & deploy
- SVN-commit
- set the new SNAPSHOT-version (same steps like above)

Especially the patching of manifests, pom's, feature.xml and product-files is very critical.
Comment 1 Jan Sievers CLA 2011-04-15 11:57:50 EDT
we have several patches by Beat Strasser pending for this story.

See

https://issues.sonatype.org/browse/TYCHO-426 	
https://issues.sonatype.org/browse/TYCHO-440
https://issues.sonatype.org/browse/TYCHO-573 	
https://issues.sonatype.org/browse/TYCHO-574 	


To set the expectations right, in my opinion there should not be a single magic black-box "tycho-release" mojo which does everything in one swoop.
My personal experience with the maven-release-plugin is that it's not modular/configurable enough. The notion of "release process" depends too much on your concrete environment and taste.
SCM checkout/checkin are out of scope for tycho.

However tycho should provide the modular pieces needed to create such a workflow.
That is mostly the steps 

"patching the manifests and poms, patching the .product-files, feature.xml and so on with the new version-numbers"
Comment 2 Tobias Oberlies CLA 2011-05-04 04:14:02 EDT
We should review & apply Beat's patches once the Tycho sources are in parallel IP at Eclipse.
Comment 3 Tobias Oberlies CLA 2011-06-10 10:59:03 EDT
FYI: Two of Beat's patches are in review:
- bug 344210 (aka https://issues.sonatype.org/browse/TYCHO-426), and
- bug 341745 (aka https://issues.sonatype.org/browse/TYCHO-558).
Comment 4 Beat Strasser CLA 2013-04-02 04:16:00 EDT
I've abandoned my efforts in the release/version plugin of tycho. I'm now concentrating my work on the version tiger which lets the developer set versions of tycho modules individually, and with Eclipse ide ui support.

https://github.com/inventage/version-tiger/wiki
Comment 5 Timo Rohrberg CLA 2014-02-19 10:17:34 EST
Is there any further progress on this issue? Or is there a solution already? Which would be super great...
Comment 6 Frank Gasdorf CLA 2014-07-08 03:16:46 EDT
(In reply to Jan Sievers from comment #1)
 
> However tycho should provide the modular pieces needed to create such a
> workflow.
> That is mostly the steps 
> 
> "patching the manifests and poms, patching the .product-files, feature.xml
> and so on with the new version-numbers"

Totally agree, it would be great to configure maven-release-plugin to invoke tycho-versions plugin for versions changes before and right after the release build.

Is there a way to do so? What about "property" conversions -DdevelopmentVersion -> -DnewVersion and additional pre-configured properties such as -Dtycho.mode=maven ?
Comment 7 Hristo Bojilov CLA 2014-08-28 05:27:43 EDT
The most crucial problem when trying to use tycho in conjunction with maven-release-plugin seems to be handle versions update. I have very simple solution for this, which doesn't require writing of entire release framework for tycho builds. maven-release-plugin can be used to generate release poms and after versions transformation we can add custom-tailored tycho goal which could sync OSGi metadata with maven poms. It shouldn't be that hard I believe.
Comment 8 Tobias Oberlies CLA 2014-09-01 07:21:32 EDT
(In reply to comment #7)
> maven-release-plugin can be used to generate release poms and
> after versions transformation we can add custom-tailored tycho goal which could
> sync OSGi metadata with maven poms. It shouldn't be that hard I believe.
Like the update-pom goal [1] but the other way (POM -> manifest)? This definitely shouldn't be hard.

(In reply to comment #6)
> Totally agree, it would be great to configure maven-release-plugin to invoke
> tycho-versions plugin for versions changes before and right after the release
> build. Is there a way to do so?
Apparently, something like this is at least almost possible with the maven-release-plugin's preparationGoals parameter: There has been a mailing list post [2] attempting this.

> What about "property" conversions -DdevelopmentVersion
> -> -DnewVersion and additional pre-configured properties such as
> -Dtycho.mode=maven ?
Is the maven-versions-plugin setting -DdevelompentVersion when it calls the preparationGoals? If yes, it would be trivial to add developmentVersion as alias for newVersion on the Tycho side. Can anyone who knows the maven-release-plugin try this out?

[1] https://www.eclipse.org/tycho/sitedocs/tycho-release/tycho-versions-plugin/update-pom-mojo.html
[2] https://dev.eclipse.org/mhonarc/lists/tycho-user/msg05790.html
Comment 9 Gunnar Wagenknecht CLA 2014-09-01 11:02:24 EDT
What is the recommended approach for qualifier support in such a scenario? 

- Is the qualifier dropped during release build? 
- Is it set as usual but Tycho forced to ignore qualifier/snapshot mismatch?
Comment 10 Hristo Bojilov CLA 2014-09-01 13:28:22 EDT
(In reply to Gunnar Wagenknecht from comment #9)
> What is the recommended approach for qualifier support in such a scenario? 
> 
> - Is the qualifier dropped during release build? 
> - Is it set as usual but Tycho forced to ignore qualifier/snapshot mismatch?

Everything depends on release policy of your company. Previously when we were using releng builder we preferred to add timestamp for qualifier replacement which shows the date & time of our release. Now we can do exactly the same thing with tycho-versions plug-in and additional shell script which generates this timestamp replacement. Of course it would be very nice if release plug-in does this automatically but this can also be achieved very easy without so many extra-complications.
Comment 11 Jan Sievers CLA 2017-04-03 03:53:39 EDT
(In reply to Tobias Oberlies from comment #8)
> (In reply to comment #7)
> > maven-release-plugin can be used to generate release poms and
> > after versions transformation we can add custom-tailored tycho goal which could
> > sync OSGi metadata with maven poms. It shouldn't be that hard I believe.
> Like the update-pom goal [1] but the other way (POM -> manifest)? This
> definitely shouldn't be hard.

bug 514163 has a proposed patch for this
Comment 12 Eclipse Genie CLA 2017-04-06 04:17:39 EDT
New Gerrit change created: https://git.eclipse.org/r/94536
Comment 13 guillaume dufour CLA 2017-04-23 16:40:57 EDT
any reviewer can say if I must change something ? or if it's ok ;o)
Comment 14 Jan Sievers CLA 2017-04-24 04:02:06 EDT
(In reply to guillaume dufour from comment #13)
> any reviewer can say if I must change something ? or if it's ok ;o)

will review until end of this week. BTW it's best if you reply to individual comments in gerrit with 'done' or other so it's easy to see whether the particular concern is adressed with a new patchset.
Comment 16 Jan Sievers CLA 2017-04-28 11:03:22 EDT
(In reply to Eclipse Genie from comment #15)
> Gerrit change https://git.eclipse.org/r/94536 was merged to [master].
> Commit:
> http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/
> ?id=9e72e1394c5d80139be3378e5231668b2b429a8b

this provides a new goal

mvn org.eclipse.tycho:tycho-versions-plugin:update-eclipse-metadata

which will update MANIFEST/feature.xml/product versions to match its respective pom versions (inverse operation of https://eclipse.org/tycho/sitedocs/tycho-release/tycho-versions-plugin/update-pom-mojo.html ).

I have no experience with maven-release-plugin myself but as far as I understood this was the missing piece to be able to use maven-release-plugin on a Tycho project.
So if someone could write up a how-to in the wiki [1] with a full example release workflow with maven-release-plugin and the new update-eclipse-metadata goal that would be great. 

@Guillaume thanks for your patch! Feel free to review/extend on the respective section of the release notes [2]

[1] https://wiki.eclipse.org/Tycho/Release_Workflow 
[2] https://wiki.eclipse.org/Tycho/Release_Notes/1.1
Comment 17 Eclipse Genie CLA 2017-05-02 03:34:31 EDT
New Gerrit change created: https://git.eclipse.org/r/96130
Comment 18 Martin Schreiber CLA 2017-05-19 09:28:26 EDT
I sucessfully tested the new feature in combination with the maven-release-plugin and will write up a how-to.
Comment 19 Martin Schreiber CLA 2017-05-30 03:32:02 EDT
Small tutorial is online: https://wiki.eclipse.org/Tycho/Release_Workflow
Comment 20 Jan Sievers CLA 2017-05-30 04:05:00 EDT
(In reply to Martin Schreiber from comment #19)
> Small tutorial is online: https://wiki.eclipse.org/Tycho/Release_Workflow

thanks a lot Martin for taking the time to write this detailed tutorial!

looking at the original requirements from comment #1 I consider this fixed now