【问题标题】:Why intelliJ IDEA dependency scope is "provided" instead of "compile"?为什么 IntelliJ IDEA 依赖范围是“提供”而不是“编译”?
【发布时间】:2017-02-24 16:13:14
【问题描述】:

我希望 IntelliJ IDEA 将我的库作为“编译”范围而不是“提供”范围。这是我的 gradle 文件的一部分:

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    // Logging
    compile 'ch.qos.logback:logback-classic:1.2.1'
    compile 'com.getsentry.raven:raven-logback:7.8.2'

    // BigQuery
    compile 'com.google.api-client:google-api-client:1.20.0'
    compile 'com.google.apis:google-api-services-bigquery:v2-rev227-1.20.0'

    // Configuration management
    compile 'commons-configuration:commons-configuration:1.10'

    //Json
    compile 'org.json:json:20160810'

    //Kafka
    compile "org.apache.kafka:kafka-clients:0.10.1.1"

    testCompile group: 'junit', name: 'junit', version: '4.12'
    testCompile 'org.assertj:assertj-core:3.0.0'
    testCompile 'org.mockito:mockito-all:1.10.19'
}

task wrapper(type: Wrapper) {
    gradleVersion = '3.4'
}

范围总是在依赖选项卡中恢复为“提供”,这很烦人:

我正在跑步: IntelliJ IDEA 2016.3.4 Build #IC-163.12024.16,建于 2017 年 1 月 31 日 JRE:1.8.0_112-release-408-b6 x86_64

【问题讨论】:

标签: java intellij-idea gradle


【解决方案1】:

这是 IntelliJ IDEA 中特定于 Gradle 3.4 的已知问题:

它已经在2017.1 EAP build 中修复。

在 IDEA 2017.1 发布之前,您可以使用 Gradle 3.3 或更早版本作为解决方法。

【讨论】:

    猜你喜欢
    • 2015-04-12
    • 1970-01-01
    • 2016-05-28
    • 2013-05-30
    • 1970-01-01
    • 2016-04-26
    • 2013-12-23
    • 2019-07-15
    • 1970-01-01
    相关资源
    最近更新 更多