Renovate: Support custom gradle wrapper distribution URLs

Created on 13 Nov 2019  路  6Comments  路  Source: renovatebot/renovate

What would you like Renovate to be able to do?
Renovate change the URL from
https://artifactory.example.com/artifactory/gradle-distribution/gradle-5.2-all.zip
to
https://services.gradle.org/distributions/gradle-6.0-all.zip
It should be possible to just increase the version number.

Describe the solution you'd like
A config option to rewrite URL鈥檚 like

rewriteURL: {
 "https://services.gradle.org/distributions": "https://artifactory.example.com/artifactory/gradle-distribution"
}
gradle feature

Most helpful comment

Resolved by #5786.

All 6 comments

@irrandon Yeah, we should definitely support private artifact repos for this, but I'd like to suggest a different approach.

Currently we hardcode the gradle source URL in lib/datasource/gradle-version/index.ts, but I think the better option would be to extract it from the gradle-wrapper.properties in lib/manager/gradle-wrapper/extract.ts

What do you think?

P.S. Congratulations on opening your first issue on GitHub! It appears to be a popular one already :smile:

Thank you :)
Yeah thats sounds better^^

This feature would be much appreciated indeed, but at least in our case authentication for the URL needs to be supported too.
It would be nice if authentication would work through already present hostRules.

Can we have an example (public) repo?

If we can detect the repository during the extract process then we can pass that to the datasource like @JamieMagee suggests. And any hostRules for that datasource would be applied like usual without requiring any Gradle-specific customisation.

Unfortunately the best thing I can offer is an example (URLs are internal so I cant share them) wrapper file:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://artifactory.example.com/artifactory/gradle/distributions/gradle-5.2.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

The artifactory repo gradle is configured to mirror services.gradle.org that means that a call to https://artifactory.example.com/artifactory/gradle/versions/all as its currently done in https://github.com/renovatebot/renovate/blob/master/lib/datasource/gradle-version/index.ts#L7 would succeed but the received list contains the "original" https://services.gradle.org/distributions/** URLs.

Resolved by #5786.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jycouet picture jycouet  路  4Comments

zephraph picture zephraph  路  3Comments

ikatyang picture ikatyang  路  4Comments

amilajack picture amilajack  路  3Comments

Siilwyn picture Siilwyn  路  4Comments