bintray / gradle-bintray-plugin

Apache License 2.0
1.28k stars 195 forks source link

Set "override = true" but still get HTTP 409 #142

Open dcram opened 8 years ago

dcram commented 8 years ago

Hi,

Here is my gradle config:

bintray {
    user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
    key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
    publish = true
    override = true
    filesSpec {
        from 'build/updatesite/'
        into '.'
    }
    pkg {
        repo = getProperty("termsuite.p2repo.name")
        name = getProperty("termsuite.p2repo.pkgname")
        desc = getProperty("termsuite.p2repo.description")
        userOrg = getProperty("termsuite.bintray.org")
        licenses = [getProperty("license")]
        vcsUrl = getProperty("termsuite.git.url")
        labels = getProperty("termsuite.p2repo.tags").split(",")
        publicDownloadNumbers = false
        version {
            name = version
            released = new Date()
        }
    }
}

And when I run gradle bintrayUpload, I get the 409 HTTP response code:

$ gradle bintrayUpload
:_bintrayRecordingCopy
:bintrayUpload FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bintrayUpload'.
> Could not upload to 'https://api.bintray.com/content/termsuite/p2/update-site/com.jfrog.bintray.gradle.BintrayExtension$VersionConfig@54e44c1d/./plugins/aopalliance_1.0.0.bnd-u6EQ5w.jar': HTTP/1.1 409 Conflict [message:Unable to upload files: An artifact with the path 'plugins/aopalliance_1.0.0.bnd-u6EQ5w.jar' already exists under another version]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.896 secs

Do you know why ? Am I doing anything wrong ?

My setup:

eyalbe4 commented 8 years ago

Thanks for reporting this @pompadour. We're checking this now.

eyalbe4 commented 8 years ago

@pompadour, We were unable to reproduce this issue. If you're still experiencing this, can you please send an email to support@jfrog.com with the issue details? Thanks.

solvingj commented 8 years ago

It's the same as the issue I reported here: https://github.com/bintray/gradle-bintray-plugin/issues/77#issuecomment-227694177

Edit: I should say it's likely related to the issue I reported. Not necessarily the same.

solvingj commented 8 years ago

@pompadour Can you check to see if it's adding "?override=true" on the end of the filenames in your maven repo?

eyalbe4 commented 8 years ago

@solvingJ, I think the issue of "?override=true" on the end of the file name exists on version 1.7, but version 1.7.1 resolves it.

dcram commented 8 years ago

@solvingJ How could I manually add the ?override=true suffix the url?

The url seems to be built by the plugin from the configurations I give. I was expecting the plugin to append ?override=true to the constructed url by setting override = true.

solvingj commented 7 years ago

@pompadour sorry for the delay. What eyalbe4 is saying is that there was a bug in version 1.7 which was adding ?override=true but doing so incorrectly, and they've fixed it in version 1.7.1. To be clear, you should not have to override anything to any urls now.

Also, if you confirm that your error is resolved, than this ticket can be closed. Mine was resolved.

prasenjit-net commented 6 years ago

this bug it still produceable when source and javadoc attached