Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally fail if user/key not given #204

Closed
tomasbjerre opened this issue Dec 7, 2017 · 5 comments · May be fixed by #212
Closed

Optionally fail if user/key not given #204

tomasbjerre opened this issue Dec 7, 2017 · 5 comments · May be fixed by #212

Comments

@tomasbjerre
Copy link

tomasbjerre commented Dec 7, 2017

I have a shared build script like:

...
bintray {
 user = System.getenv('BINTRAY_USER')
 key = System.getenv('BINTRAY_KEY')
...

I spent about an hour troubleshooting why I suddenly was unable to release from my laptop. After a while, when running with -i, I saw a small info log about not running bintrayUpload because no user was specified.

If I could set a property that says the plugin should fail, instead of just ignoring the missing property, that would have med me realize this much faster. Or always fail if the property is not set, unless there is a use case where someone would want to run without a user.

Same thing with mavenCentralSync. If someone configures sync = true but configures no user/password, I think there should be an error.

@vgaidarji
Copy link

Same happened to me, build was always successful but bintrayUpload (1.8.0 plugin version) did nothing. I had to dig deeper with ./gradlew bintrayUpload --debug to actually find that user/key were not passed correctly to bintray closure.

@sebersole
Copy link

Same thing with mavenCentralSync. If someone configures sync = true but configures no user/password, I think there should be an error.

I completely disagree here. We publish our package as part of an organization and that organization has its OSSRH credentials on its profile. Those are the values that should be used by the Bintray Maven Central sync stuff - and in fact when you do this from the UI that is exactly what happens if you do not specify any values here.

All that said, I'm not so sure that this is the same thing that happens from the plugin. I do not specify the sync creds in the plugin config for the reasons I described above - but the sync does not automatically happen. Does the plugin just ignore the mavenCentralSync section completely if no creds are given? If so, it shouldn't. It should just send the empty values. I'll wait to open a new issue until its confirmed that this is what happens.

@AlexeiVainshtein
Copy link
Contributor

Thank you for opening this issue @tomasbjerre . We are investigating this issue and how to improve this.

@AlexeiVainshtein
Copy link
Contributor

Hi @tomasbjerre

I just wanted to update you upon the release of the new version 1.8.1 of the Gradle Bintray Plugin. Previously, if username or password were missing, the bintrayUpload was skipped (as you encountered). With this version, if a username or password are missing, bintrayUpload will not be skipped but the upload will fail with a 401 error:

> Could not publish 'null/maven/gradle.tests.pkg.name5/1528775107200': HTTP/1.1 401 Unauthorized [message:This resource requires authentication]

Please let us know if this suits your needs.

Thanks,

@tomasbjerre
Copy link
Author

Great thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants