-
Notifications
You must be signed in to change notification settings - Fork 198
Ignore missing bintray environment in root project. #74
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
Comments
Here is a quick workaround for this issue. I've added the following code to the top of my plugins {
// use the bintray gradle plugin to upload build artifacts.
id "com.jfrog.bintray" version "1.2"
}
// only our subprojects have a bintray configuration. replace the root project's
// `bintrayUpload` task with one that restricts the calls to the subprojects.
project.afterEvaluate {
task bintrayUpload(group: "publishing", overwrite: true) {
dependsOn subprojects.bintrayUpload
}
} Also note that I used |
+1 same problem. Thanks @hastebrot for the workaround wfm. |
Note, the workaround also disables version signing, publishing and maven sync from the plugin. These are defined in the original |
Another workaround: move the
This just makes sure no artifacts are published for the (empty) root project, but everything else goes as normal. Or even specify the configurations / publications conditionally to avoid confusion:
|
so in this case if the configuration is empty then gradle will not run any tasks on the root project. |
To clarify: the original Gradle task |
Please fix this. How can I publish subproject to bintray without modifying root buildscript? Why do I have to modify root buildscript at all??? |
This is my solution:
Note:Don't use apply plugin: 'com.jfrog.bintray'
|
@DTHeaven This fixed it for me. Thanks! |
Nope, not working for me. I even copied the whole repository and changed IDs to get it to work, still getting the same annoying error. |
OMG. Finally. The solution was to run |
@hastebrot, @milosmns, @mitochondrion, @DTHeaven and @jamescway, |
Well.. it would be a huge help if you could direct the command to the subproject when there is no bintray config in the root. But since I left a comment in my script, I won't be making the same mistake again :) |
Thanks! Looking forward to it 👍 |
@milosmns and all, |
@eyalbe4 Kewl, thanks! Here's a beer! 🍺 |
@eyalbe4 Thank U, Version 1.7.2 with this fix has been released! It's right! |
The fix for this issue was wrong, it just fails to run the task silently now, which can cause a lot of pain when you think you've published your artifact but you didn't. I don't understand why it is expected that a root project that has no configuration for the bintray plugin should allow the plugin to be applied on it without failing. Shouldn't everyone just configure the plugin in the sub-projects they actually use the plugin on? If the concern is that the subProjects share some configuration, Gradle has many ways for sharing configuration, for example, from an external gradle file which the subprojects apply. Sorry if I misunderstand this issue, but it looks to me that you just made the plugin task silently fail to fix this one particular case, without taking into consideration that it SHOULD fail in most other scenarios. |
@renatoathaydes, |
Hey,
(I use gradle-bintray-plugin 1.2 and Gradle 2.4.)
I have a Gradle build configuration that contains an empty root project (no source sets) with tasks that call their counterparts in subprojects for convenience. The subprojects configure the
bintray
environent closure (i.e.user
,key
,pkg
, ...).The gradle-bintray-plugin adds the
bintrayUpload
task to the root project, but when I call it I get following error message:Calling
bintrayUpload
on the subprojects works as expected.It would be nice if the missing
bintray
environment closure could be ignored and the task in the root project could just call its counterpartbintrayUpload
in the subprojects.The text was updated successfully, but these errors were encountered: