0

So I have a Bintray repository, but I'm having difficulty uploading to it from gradle. Well, what I mean is version management is not working how I want it, currently for every single .jar I upload, I have to increment the version in my configuration, and dependencies. I know this is not how it's supposed to be done. My question is how do I automate/implement VCS tagging with Bintray. Right now my configuration for uploading looks like so (using the bintray plugin):

bintray {
user = "$bintrayUser"
key = "$bintrayKey"
publications = ['maven']
dryRun = false
publish = true
pkg {
    repo = "$targetBintrayRepo"
    name = "$targetBintrayPackage"
    desc = ''
    websiteUrl = "$programWebsiteUrl"
    issueTrackerUrl = "$programIssueUrl"
    vcsUrl = "$programVcsUrl"
    licenses = ["$programLicense"]
    labels = []
    publicDownloadNumbers = true

    version {
        name = "$programVersion"
        released = new java.util.Date()
        vcsTag = "$programVcsTag"
    }

}
}

And my variables are:

def programVersion = '0'
def programVcsTag = '0.0.0'
def programGroup = 'com.gmail.socraticphoenix'
def targetBintrayRepo = 'Main'
def targetBintrayPackage = 'java-api'
def programLicense = 'MIT'
def programWebsiteUrl = 'https://github.com/meguy26/PlasmaAPI'
def programIssueUrl = 'https://github.com/meguy26/PlasmaAPI/issues'
def programVcsUrl = 'https://github.com/meguy26/PlasmaAPI.git'

Yet here no tags appear, and running publish again (even with a different vcs tag) results in a version already exists error. (Could not upload to 'https://api.bintray.com/content/meguy26/Main/java-api/0/com/gmail/socraticphoenix/PlasmaAPI/0/PlasmaAPI-0.jar': HTTP/1.1 409 Conflict [message:Unable to upload files: An artifact with the path 'com/gmail/socraticphoenix/PlasmaAPI/0/PlasmaAPI-0.jar' already exists])

Sorry if I'm being noobish, but I don't understand why its not working, I filled out all the appropriate variables (I thought)

Community
  • 1
  • 1
Socratic Phoenix
  • 556
  • 1
  • 7
  • 19

1 Answers1

1

Bintray does not support multiple tags per version. Version is a unique string. If you want to release something from the same version with different tags, compose a Bintray version string with from your program version and tag, e.g. "$programVersion-$programVcsTag"

JBaruch
  • 22,610
  • 5
  • 62
  • 90
  • I'm not exactly sure what you mean. Where would I put the composed string? Also, the end result I want is the ability to publish an 'update' to a version that will be downloaded by a gradle build script (that depends on the artifact) without the need to change the version number – Socratic Phoenix Nov 23 '15 at 18:21
  • the string I suggest should go to the `version.name`. The 'update' to a version - that's a very bad idea. Binary under a version should be immutable (for tons of reasons, one of them – released binaries are cached by build tools). If you want to push an update, you'll have to craft a new version. – JBaruch Nov 23 '15 at 19:17
  • No, I don't wish to overwrite the binaries under the versions, but for example, I have a project that depends on an API, and that API consistently releases updated binaries, in their repo, under the same version. All the binaries are still there, but gradle will re-download the most recent one if I refresh it. What I'm looking to do is have the same behavior for what I want to publish. – Socratic Phoenix Nov 24 '15 at 13:49
  • Nope. Releasing different artifacts under same version is not supported and won't be supported in Bintray, since it's a wrong thing to do. For continuously changing artifacts you can work with snapshot (or integration) versions, but they are development time artifacts and aren't belong to distribution platform. You're more than welcome to use oss.jfrog.org – free Artifactory account for snapshots. – JBaruch Nov 24 '15 at 20:52
  • Oh......... I get it now... The API I'm working with is currently in snapshot stage. I now feel noobish. Thanks for your help – Socratic Phoenix Nov 24 '15 at 22:13
  • No problem at all. Feel free to ask additional questions if you need help wit Artifactory. Also, accept and vote will be appreciated. – JBaruch Nov 25 '15 at 15:34