Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update dependencies in Gradle

Can any body can tell me how can I do something like maven install -U (update dependencies) in gradle.

I have problem I have added new dependency to my build.gradle file

dependencies {
    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('org.springframework.boot:spring-boot-starter-thymeleaf')
    compile('org.springframework.boot:spring-boot-starter-web')
    compile("org.springframework.boot:spring-boot-starter-security")
    runtime('com.h2database:h2')
    testCompile('org.springframework.boot:spring-boot-starter-test') 
}

New dependency is:

compile("org.springframework.boot:spring-boot-starter-security")

And during build or project synchronize my IntelliJ (version 14) is not even trying download this new dependency (I'm using gradle version 2.5)

In maven project IntelliJ had something like download maven dependencies. But for Gradle I don't see anything like this. This is like my project looks like

And can any body tell me why I don't see any *.jar on project list like maven does?

enter image description here

like image 369
Piotr Żak Avatar asked Oct 30 '22 16:10

Piotr Żak


1 Answers

Using IntelliJ

In the Gradle tool window, click refresh button. Here is the screen:

Gradle tool window

Using terminal

You must add to your build.gradle this line

apply plugin: 'idea'

And next if you are adding some dependencies and you want synchronize IntelliJ, you just use command

gradle idea
like image 119
Mateusz Korwel Avatar answered Nov 15 '22 03:11

Mateusz Korwel