Authenticated Gradle Distribution - Re-download dependencies and sync project
My team is using an Authenticated Gradle Distribution. The distributionUrl is defined in gradle-wrapper.properties. Our basic auth credential ssystemProp.gradle.wrapperUser and systemProp.gradle.wrapperPassword and defined in ~/.gradle/gradle.properties.
We can successfully pull down our distribution via ./gradlew on the command line. This is an extra step in the process. We are wanted to open up and/or pull down sources from source control via IntelliJ.
I'm working on Mac 10.12.5, with IDEA 2017.2.5
Here are the logs from IntelliJ. It looks like it's not using the credentials(systemProp.gradle.wrapperUser and systemProp.gradle.wrapperPassword) defined in ~/.gradle/gradle.properties.
Are there IntelliJ environment variables, settings, and/or some other configurations that need to be set?
Thanks!
请先登录再写评论。
See https://youtrack.jetbrains.com/issue/IDEA-176428 .
You can set system properties via -DsystemProp.gradle.wrapperPassword=... here:
Thanks for the quick response. We has tried this by adding username and password to Gradle VM Options. We didn't have any luck pulling down our distribution within IntelliJ.
Is there a way to turn logging on while running ./gradlew?
I'm unsure if there is a redirect happening, which doesn't seam to effect ./gradlew from the command line, or if it's an unauthroized exception, which we do not see in the log. We only see an error around unzipping the file.
Before we test any of this we are wiping out ~/.gradle/wrapper/dists/*
Try with https://www.jetbrains.com/idea/nextversion/, it has additional logging enabled in the special build tool window.
Please see if https://youtrack.jetbrains.com/issue/IDEA-176428#comment=27-2514707 comment helps.
Resolved. Setting -Dgradle.wrapperUser and -Dgradle.wrapperPassword in custom vm options resolved the issue. I had to restart IntelliJ after making those edits to the custom vm options.
https://youtrack.jetbrains.com/issue/IDEA-176428#comment=27-2514707
My version of IntelliJ (2019.3) does not have an option on that settings page for Gradle VM options. All it has is "Gradle: Use Grade from <dropdown> Gradle JVM <dropdown>"
Lee Meador You should use org.gradle.jvmargs property in gradle.properties file instead. This setting was removed so that the builds are consistent between the IDE and the command line and the settings are set only in one place.