Renovate: Support for Gradle behind proxy

Created on 2 Apr 2019  路  12Comments  路  Source: renovatebot/renovate

Gradle unable to get required resources. Should these be baked into image?

renovate.json

{
  "gradle": {
    "enabled": true
  }
}

Log output:

DEBUG: Creating init.gradle file (repository=XXX/XXX)
--
聽 | DEBUG: Start gradle command (repository=XXX/XXX)
聽 | "cmd": "gradle --init-script init.gradle dependencyUpdates -Drevision=release"
聽 | WARN: Gradle command gradle --init-script init.gradle dependencyUpdates -Drevision=release failed. Exit code: 1. (repository=XXX/XXX)
聽 | "err": {
聽 | "name": "ChildProcessError",
聽 | "code": 1,
聽 | "childProcess": {},
聽 | "stdout": "\nWelcome to Gradle 4.10.2!\n\nHere are the highlights of this release: ...
  | "stderr": "Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'XXXXX'
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve gradle.plugin.se.patrikerdes:gradle-use-latest-versions-plugin:0.2.3.
     Required by:
         project :
      > Could not resolve gradle.plugin.se.patrikerdes:gradle-use-latest-versions-plugin:0.2.3.
         > Could not get resource 'https://plugins.gradle.org/m2/gradle/plugin/se/patrikerdes/gradle-use-latest-versions-plugin/0.2.3/gradle-use-latest-versions-plugin-0.2.3.pom'.
             > Could not GET  
...

help wanted gradle priority-3-normal feature

All 12 comments

I assume you're passing HTTP_PROXY/HTTPS_PROXY into the Pro container?

Looks like Gradle needs such settings configured manually rather than via environment: https://docs.gradle.org/current/userguide/build_environment.html#sec:accessing_the_web_via_a_proxy

Unfortunately no wider internet access from this environment.

Didn't have any success caching the dependencies in the image. Next thought is to setup redirects in the image to hit an Artifactory mirror.

We have a similar situation where we need it to hit a maven mirror in artifactor, and an npm mirror in npm Enterprise.

@matthargett I assume the npm part works for you? And that when you mention maven repository then is it for Gradle or Maven?

We're working on a JS-based rewrite of the Gradle parsing and updating, this will then "automatically" work with proxies: https://github.com/renovatebot/renovate/issues/3608

@patrickmarabeas are you still trialing Renovate?

Not actively at this point.

NPM / Artifactory / mirrors have been validated as working. Working on getting a project to start properly trialling it.

Gradle and Helm support are needed before any other integration is possible.

I've transferred this into the main repo because it relates to a proxy feature for Gradle that is not specific to the Pro version

From https://stackoverflow.com/a/22666646/3005034

Looks like we can pass to gradlew through CLI: gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 - Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129 -Dhttps.proxyUser=user -Dhttps.proxyPassword=pass -Dhttp.proxyUser=user -Dhttp.proxyPassword=pass -Dhttp.nonProxyHosts=host1.com|host2.com

I'm marking this as ready but would need someone willing and able to test out a feature branch with a real setup before I would start it.

Hey. Any updates? Seems we are struggeling with the same issue.

./gradlew --init-script renovate-plugin.gradle renovate

throws ConnectionException behind proxy. GRADLE_OPTS and http_proxy/https_proxy are not working.

A community pr would be welcome, as no maintainer is using a proxy setup. 馃檭

I switched to the new gradle-lite manager. Seems to work 馃槂

Was this page helpful?
0 / 5 - 0 ratings