Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update Gradle dependencies from command line?

Tags:

java

gradle

I have following build.gradle file:

apply plugin: 'java' apply plugin: 'eclipse'  sourceCompatibility = 1.7 version = '1.0'  repositories {     mavenCentral() }  dependencies {     compile 'org.springframework:spring-core:4.1.1.RELEASE'     compile 'org.springframework:spring-context:4.1.1.RELEASE'     testCompile group: 'junit', name: 'junit', version: '4.+' } 

I run following command:

$ gradle --refresh-dependencies 

But it does nothing. The dependencies do not get updated and do not reflect on classpath. The output from command is:

:help  Welcome to Gradle 2.1.  To run a build, run gradle <task> ...  To see a list of available tasks, run gradle tasks  To see a list of command-line options, run gradle --help  BUILD SUCCESSFUL  Total time: 5.999 secs 

Doing this via Eclipse gradle plugin is working though.

like image 239
Kshitiz Sharma Avatar asked Nov 06 '14 06:11

Kshitiz Sharma


People also ask

How do I update Gradle dependencies in eclipse?

You have to select "Refresh Dependencies" in the "Gradle" context menu that appears when you right-click the project in the Package Explorer. Show activity on this post. Show activity on this post. Show activity on this post.


1 Answers

gradle --refresh-dependencies <task> 
like image 131
Jeffrey Mixon Avatar answered Sep 17 '22 15:09

Jeffrey Mixon