Gradle不下载IntelliJ IDEA中的依赖项 [英] Gradle not downloading dependencies in intelliJ idea

查看:1043
本文介绍了Gradle不下载IntelliJ IDEA中的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

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:

在文件>设置>成绩>全局Gradle设置中取消选中离线工作"

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

这篇关于Gradle不下载IntelliJ IDEA中的依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆