2

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:

  1. Remove existing artifacts if pushing same version again
  2. 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.

TylerH
  • 20,799
  • 66
  • 75
  • 101
pPanda_beta
  • 618
  • 7
  • 10
  • You might want to try out the `override` url parameter as in `"https://api.bintray.com/maven/${binTrayUserName}/maven/${artifactName}/;publish=1;override=1"`. Eventually, you need pipe it through the `uri` function as in `url = uri("https://api.bintray.com/maven/${binTrayUserName}/maven/${artifactName}/;publish=1;override=1")`. – JJD Nov 27 '20 at 22:19
  • I'm also quite annoyed that every guide I can find recommends pulling in the Bintray plugin which seems to add very little (and is a bit awkward to use from the Kotlin DSL) – Bart van Heukelom Dec 03 '20 at 00:56
  • @JJD I can override the url but what about deleting the corrupted versions? – pPanda_beta Jan 28 '21 at 10:20
  • Some deletion can be done on the Bintray web interface. For anything remaining you have to contact the Bintray support, I believe. – JJD Jan 28 '21 at 13:17
  • 1
    What you are suggesting is correct for organic operations only. My main motive was to automate everything from CI+CD – pPanda_beta Jan 29 '21 at 00:20

0 Answers0