Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do You Specify Where The Gradle Wrapper Installs Gradle?

Tags:

gradle

gradlew

I have an off the shelf application that ships a version of gradle with it. It also has scripts that are hard coded to set GRADLE_HOME to this location.

I want to zip up this dir, put it in nexus and replace it with the gradle wrapper.

How do I configure the gradle wrapper to download this zip from nexus and extract it to a specific location in the project?

EDIT: In the gradle-wrapper.properties I have distributionPath=wrapper/gradle

However, I end up with it being unzipped to ...\wrapper\gradle\gradle-2.3-bin\8gn7esgljqyucijpbynjk93oc\gradle-2.3

How do I get it to unzip to the path I specified and not to the subdirs?

like image 270
opticyclic Avatar asked Dec 03 '25 08:12

opticyclic


1 Answers

The location to which Gradle gets unpacked is a combination of the distributionBase and distributionPath properties in gradle-wrapper.properties file.

The location specified by distributionPath will always be considered as relative to distributionBase. The only available values for distributionPath are GRADLE_USER_HOME and PROJECT. Even when using PROJECT the wrapper will still generate the folder structure you see above.

If you want to control this more precisely I'd suggest not relying on the wrapper to do this and instead add a task to your build specifically for this purpose.

like image 188
Mark Vieira Avatar answered Dec 06 '25 00:12

Mark Vieira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!