Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle not downloading dependencies in intelliJ idea

I am building a Java project in Intellij Idea IDE. Following is my build.gradle file:

group 'fyp_group09'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.5

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.11'
    compile 'log4j:log4j:1.2.17'
}

I use a proxy connection provided by school and have done the required proxy setup in the IDE. The log4j dependencies are not getting downloaded. I've refreshed the gradle project many times, but it does not download the dependencies and does not even give any error. How can I solve this problem?

like image 875
cnova Avatar asked Apr 05 '16 19:04

cnova


People also ask

How do I re import Gradle dependencies in IntelliJ?

In the Gradle tool window, right-click your main project and from the context menu select Composite Build Configuration. In the Gradle Project Build Composite dialog, select projects that you want to include in your Gradle composite build. Re-import your main Gradle project.


2 Answers

The following trick as given here, worked well for me:

Un-check "Offline work" in File>Settings>Gradle>Global Gradle Settings

like image 181
cnova Avatar answered Dec 03 '22 13:12

cnova


We had this, worked after doing File>Invalidate Caches / Restart...

like image 23
tplive Avatar answered Dec 03 '22 15:12

tplive