Piotr Żak
Piotr Żak

Reputation: 2413

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

Upvotes: 7

Views: 9874

Answers (2)

Mateusz Korwel
Mateusz Korwel

Reputation: 1148

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

Upvotes: 4

Piotr Żak
Piotr Żak

Reputation: 2413

If any one have problem with finding Gradle Tool Window it's in:

View | Tool Windows | Gradle

Upvotes: 0

Related Questions