rpm-maven-plugin icon indicating copy to clipboard operation
rpm-maven-plugin copied to clipboard

Does not handle RPM compatible versions with build number

Open asgeirn opened this issue 8 years ago • 12 comments

Given a POM version number of 1.0.0-1, I would expect the RPM plugin to produce an RPM with version 1.0.0 and release 1. This is numbering that is perfectly valid both for Maven and RPM.

Instead, it produces an RPM with version 1.0.0 and release 1_1.

asgeirn avatar Jun 27 '16 13:06 asgeirn

It is an intentional design where user can upgrade existing snapshot rpm to release rpm.

dantran avatar Jun 27 '16 18:06 dantran

My suggested modification does not change this behavior, Yum still treats 1.0.0 and 1.0.0-1 as updates to 1.0.0-SNAPSHOT. The only downside with my modification is that 1.0.0 and 1.0.0-1 get identical version and release values.

asgeirn avatar Jun 28 '16 08:06 asgeirn

what about RPM -U ?

dantran avatar Jun 28 '16 18:06 dantran

Yes, rpm -U behaves in the expected way. It permits upgrades from 1.0.0-SNAPSHOT to 1.0.0-alpha-1, and from 1.0.0-alpha-1 to 1.0.0. It does not permit upgrades from 1.0.0 to 1.0.0-1, since the plugin defaults the release to 1 if none is specified. Upgrading to 1.0.0-2 does however work.

And any attempt to go in the opposite direction is rejected on the basis of the version being older.

asgeirn avatar Jun 29 '16 08:06 asgeirn

Since this is a new behavior, we still need to provide a flag to activate. If it works out well, we can make it default behavior on next major release(3)

dantran avatar Jun 29 '16 08:06 dantran

Ok. I'm a bit rusty in Mojos, where would I need to define this flag?

asgeirn avatar Jun 29 '16 08:06 asgeirn

any MOJO that uses src/main/java/org/codehaus/mojo/rpm/VersionHelper.java

VersionMojo and AbstractRPMMojo

Thanks for helping out

dantran avatar Jun 29 '16 09:06 dantran

Please point to a doc that claims.

1.0.0-1 > 1.0.0-1_SNAPSHOTSNAPSHOT20160701004053

according to this https://fedoraproject.org/wiki/Archive:Tools/RPM/VersionComparison?rd=Tools/RPM/VersionComparison

1.0.0-1_SNAPSHOTSNAPSHOT20160701004053 is newer and therefore not upgradeable to 1.0.0-1

dantran avatar Jul 01 '16 00:07 dantran

just tested out with your proposal to remove '_1' at release time

rpm -U brs-firewall-1.0.0-6.x86_64.rpm

it issues the following error

package brs-firewall-1.0.0-6_SNAPSHOT20160701221949.x86_64 (which is newer than brs-firewall-1.0.0-6.x86_64) is already installed

dantran avatar Jul 02 '16 19:07 dantran

However, option without _1 is still a good use case, where we have projects that that continuously building RC/release builds. they stop building snapshot after entering RC build phase

dantran avatar Jul 02 '16 20:07 dantran

Huh. What was the project versions in the POM used when building these two packages? It is a bit puzzling to me..

Den lør. 2. jul. 2016, 22:12 skrev Dan Tran [email protected]:

However, option without _1 is still a good use case, where we have projects that that continuously building RC/release builds. they stop building snapshot after entering RC build phase

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mojohaus/rpm-maven-plugin/issues/55#issuecomment-230119856, or mute the thread https://github.com/notifications/unsubscribe/AADk9iN74RrwpQbFVq26E1tNZZJOJCK0ks5qRsYqgaJpZM4I_Ey7 .

asgeirn avatar Jul 02 '16 20:07 asgeirn

I manually built those 2 artifacts to make you aware of the requirement

dantran avatar Jul 04 '16 00:07 dantran