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

Properties defined in HOME_DIR/.gradle/gradle.properties not passed to downstream tasks #147

Closed
henryju opened this issue Nov 3, 2015 · 3 comments

Comments

@henryju
Copy link

henryju commented Nov 3, 2015

Hi,

I'm trying to use the release plugin in combination with official publish-plugin (to publish plugin on Gradle plugin portal).

I put credentials in HOME_DIR/.gradle/gradle.properties and it is working fine when I do ./gradlew publishPlugins.
But when trying to have release + publish in one run (adding afterReleaseBuild.dependsOn publishPlugins) it fails saying that credentials are not defined:

./gradlew release
:release
:gradle-sonarqube-plugin:createScmAdapter
:gradle-sonarqube-plugin:initScmAdapter
:gradle-sonarqube-plugin:checkCommitNeeded
:gradle-sonarqube-plugin:checkUpdateNeeded
:gradle-sonarqube-plugin:unSnapshotVersion
> Building 0% > :release > :gradle-sonarqube-plugin:confirmReleaseVersion
??> This release version: [1.1] 
:gradle-sonarqube-plugin:confirmReleaseVersion
:gradle-sonarqube-plugin:checkSnapshotDependencies
:gradle-sonarqube-plugin:runBuildTasks
:gradle-sonarqube-plugin:beforeReleaseBuild UP-TO-DATE
:gradle-sonarqube-plugin:compileJava UP-TO-DATE
:gradle-sonarqube-plugin:compileGroovy UP-TO-DATE
:gradle-sonarqube-plugin:processResources UP-TO-DATE
:gradle-sonarqube-plugin:classes UP-TO-DATE
:gradle-sonarqube-plugin:jar UP-TO-DATE
:gradle-sonarqube-plugin:groovydoc UP-TO-DATE
:gradle-sonarqube-plugin:publishPluginGroovyDocsJar UP-TO-DATE
:gradle-sonarqube-plugin:publishPluginJar UP-TO-DATE
:gradle-sonarqube-plugin:javadoc UP-TO-DATE
:gradle-sonarqube-plugin:publishPluginJavaDocsJar UP-TO-DATE
:gradle-sonarqube-plugin:assemble UP-TO-DATE
:gradle-sonarqube-plugin:licenseMain UP-TO-DATE
:gradle-sonarqube-plugin:licenseTest UP-TO-DATE
:gradle-sonarqube-plugin:license UP-TO-DATE
:gradle-sonarqube-plugin:compileTestJava UP-TO-DATE
:gradle-sonarqube-plugin:compileTestGroovy UP-TO-DATE
:gradle-sonarqube-plugin:processTestResources UP-TO-DATE
:gradle-sonarqube-plugin:testClasses UP-TO-DATE
:gradle-sonarqube-plugin:test UP-TO-DATE
:gradle-sonarqube-plugin:check UP-TO-DATE
:gradle-sonarqube-plugin:build UP-TO-DATE
:gradle-sonarqube-plugin:publishPlugins
Publishing plugin org.sonarqube version 1.1
:gradle-sonarqube-plugin:publishPlugins FAILED
:gradle-sonarqube-plugin:runBuildTasks FAILED
:release FAILED
Release process failed, reverting back any changes made by Release Plugin.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':publishPlugins'.
> Missing publishing keys. Please set gradle.publish.key and gradle.publish.secret system properties or login using the login task.

The only solution I found was to pass properties directly on command line:
./gradlew release -Dgradle.publish.key=xxxxx -Dgradle.publish.secret=yyyyy

@danez
Copy link
Contributor

danez commented Nov 3, 2015

I will have a look soon.

@danez
Copy link
Contributor

danez commented Nov 4, 2015

I do exactly the same here in the release plugin vor the bintray credentials and it works fine.
The release plugin is not doing anything special in terms of loading/reading properties. All the subprocesses are started as the same user you start the initial release process.
I found this, which makes me think that something is wrong with the publish plugin.
https://issues.gradle.org/browse/GRADLE-3281

Though I couldn't found the source of the plugin publish plugin to check what they are doing exactly.
But I asked in the forum: https://discuss.gradle.org/t/where-can-i-find-the-source-of-the-pluginpublishplugin/12607

@henryju
Copy link
Author

henryju commented Nov 4, 2015

You are right, I have added project local gradle.properties for the release plugin to work so this may be the cause of the issue. Thanks for the investigation!

@henryju henryju closed this as completed Nov 4, 2015
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

No branches or pull requests

2 participants