mockito / shipkit

Toolkit for shipping it used by Mockito library
http://shipkit.org
MIT License
158 stars 35 forks source link

Allow same version publication #772

Closed TimvdLippe closed 5 years ago

TimvdLippe commented 5 years ago

I wanted to release a new version of Mockito. release/2.x at that point was at 2.24.4, with the next-version-to-be 2.24.5. To be able to release, I edited version.properties to set the current release version to 2.24.4. Then I made a commit with the message [ci maven-central-release] Release 2.24.4.

However, this then failed with https://travis-ci.org/mockito/mockito/jobs/494939469#L1658-L1660 It tried to recreate the tag. Could we detect that the tag already exists and skip that step?

In other words, how do I release the currently built version to Maven central without making a new special patch version (which is totally equivalent to the previous patch version)?

mstachniuk commented 5 years ago

You shouldn't downgrade version property in version.properties. If I understand correctly you released 2.24.4 only to the JCenter and would synchronize it with Maven Central? If yes, then you should be able to promote to Maven Central by click somewhere in Bintray. P.S. [ci maven-central-release] is a custom Mockito only feature: https://github.com/mockito/mockito/blob/4f72147c464c1a8a642d01fc3334e98e92b464cd/gradle/shipkit.gradle#L78

mstachniuk commented 5 years ago

I thought a little bit more about this case. Skipping check if the tag exists is not enough. In Bintray configuration the override flag needs to be set to true:

override = false //[Default: false] Whether to override version artifacts already published 

Src: https://github.com/bintray/gradle-bintray-plugin#Maven_Central_Sync

But re-publishing artifact in Maven Central will not work: https://central.sonatype.org/articles/2014/Feb/06/can-i-change-a-component-on-central/

The suggested feature will add more complexity to the Shipkit and will break the Maven Central / Semantic Versioning rules. I won't implement that.

@TimvdLippe Please comment or close the ticket if you agree with me.

TimvdLippe commented 5 years ago

That's a bummer, but understandable. Thanks for the explanation!