Dims
Dims

Reputation: 51039

How to change dependency in Gradle IntelliJ project?

Suppose IntelliJ says that my project uses some version of the library, like this:

enter image description here

If I press F4 I see the following entry:

enter image description here

Where did it take it? How to change the version?

Upvotes: 1

Views: 72

Answers (1)

Tim Büthe
Tim Büthe

Reputation: 63734

You projects contains a file called build.gradle which contains dependencies that look something like this:

 dependencies {
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.7'
    compile group: 'org.slf4j', name: 'jul-to-slf4j', version: '1.7.7'
    compile group: 'ch.qos.logback', name: 'logback-classic', '1.0.13': logbackVersion
}

You can simply change the dependencies there. Afterwards Gradle will fetch the new dependencies automatically, if activated. If not, use the "Refresh all gradle projects" button from the "Gradle" view (shown in the screenshot)

IntelliJ Gradle dependencies

Upvotes: 2

Related Questions