Gradle:禁用自动下载依赖项

时间:2016-04-02 08:12:59

标签: gradle

我在Eclipse中创建了一个Gradle项目,并创建了以下build.gradle

// Apply the java plugin to add support for Java
apply plugin: 'java'

// In this section you declare where to find the dependencies of your project
repositories {
    // Use 'jcenter' for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
    jcenter()
}

// In this section you declare the dependencies for your production and test code
dependencies {
    // The production code uses the SLF4J logging API at compile time
    compile 'org.slf4j:slf4j-api:1.7.18'

    // Declare the dependency for your favourite test framework you want to use in your tests.
    // TestNG is also supported by the Gradle Test task. Just change the
    // testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
    // 'test.useTestNG()' to your build script.
    testCompile 'junit:junit:4.12'
}

之后,slf4j模块已下载并缓存在~/.gradle

但我不想要它!我的Linux发行版在存储库中包含slf4j,因此我更倾向于使用pacman / apt-get /等。安装所需的模块。

我宁愿Gradle错误地说模块丢失了,或者只有在指定了标志时才下载所需的模块。

如何阻止Gradle过度热心?

0 个答案:

没有答案