Gradle没有在intelliJ idea中下载依赖项[英] Gradle not downloading dependencies in intelliJ idea

本文是小编为大家收集整理的关于Gradle没有在intelliJ idea中下载依赖项的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我正在Intellij Idea IDE中构建Java项目. 以下是我的build.gradle文件:

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'
}

我使用学校提供的代理连接,并在IDE中完成了所需的代理设置. log4j依赖项没有下载.我已经多次刷新了Gradle项目,但是它没有下载依赖项,甚至没有任何错误.我该如何解决这个问题?

推荐答案

给定的以下技巧在这里,对我来说很好:

在文件>设置> Gradle> Global Gradle设置

中未检查"离线工作"

其他推荐答案

我们有此功能,在执行文件>无效的caches/重新启动...

后工作

本文地址:https://www.itbaoku.cn/post/1574926.html

问题描述

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?

推荐答案

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

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

其他推荐答案

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