Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download dependencies in gradle

Tags:

gradle

I have a custom compile task.

task compileSpeedTest(type: JavaCompile) {     classpath = files('build')     source = fileTree('src/test/java/speed')     destinationDir = file('bin') } 

Gradle doesn't try to download dependencies before its execution. I cannot find anywhere a task name which does it to add it on list dependsOn.

like image 220
Daniil Iaitskov Avatar asked Feb 16 '14 17:02

Daniil Iaitskov


People also ask

How do I download all dependencies in Gradle?

Downloading java dependencies is possible, if you actually really need to download them into a folder. Download the dependencies (and their dependencies) into the folder runtime when you execute gradle getDeps .


1 Answers

Downloading java dependencies is possible, if you actually really need to download them into a folder.

Example:

apply plugin: 'java'  dependencies {   runtime group: 'com.netflix.exhibitor', name: 'exhibitor-standalone', version: '1.5.2'   runtime group: 'org.apache.zookeeper',  name: 'zookeeper', version: '3.4.6' }  repositories { mavenCentral() }  task getDeps(type: Copy) {   from sourceSets.main.runtimeClasspath   into 'runtime/' } 

Download the dependencies (and their dependencies) into the folder runtime when you execute gradle getDeps.

like image 134
Evgeny Avatar answered Oct 04 '22 12:10

Evgeny