I want to publish my maven artifacts to standard maven repositories. For that the first example I chose is Bintray by JFrog. Unfortunately this didn’t go well; I had to add two hacks:
- Remove existing artifacts if pushing same version again
- Delete some corrupted versions after maven publish
The entire code can be found at https://github.com/pPanda-beta/cassandra-java-driver-reactive-mapper/blob/4b1395db443facb188ed4aee120c6db7864908b7/cassandra-java-driver-reactive-mapper-reactor-core/build.gradle#L93-L122
The uploaded artifacts are at https://bintray.com/ppanda-beta/maven/cassandra-java-driver-reactive-mapper-reactor-core
Why maven-publish?
The main objective here is to keep maven repositories as a standard specification not specific to any provider. I want to represent an repo as { url, username, password }
. The way of publishing should not change based on the repo provider.
Please do not suggest I use a plug other than 'maven-publish'; I don't want to use com.jfrog.bintray
or com.jfrog.artifactory
.
The future of those artifacts is to reside in a more popular and standard maven repo like maven central, GitHub maven repo, etc. Until that time comes, I want to standardise the gradle script to work with any maven repo. This is very similar to a docker container registry. Whether it is global docker hub or redhat cr or google cr, we use the same docker clients.