Gradle not downloading dependencies in intelliJ idea

人盡茶涼 提交于 2019-12-07 02:11:28

问题


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?


回答1:


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

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




回答2:


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



来源:https://stackoverflow.com/questions/36435598/gradle-not-downloading-dependencies-in-intellij-idea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!