Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
424 views
in Technique[技术] by (71.8m points)

java - Why intelliJ IDEA dependency scope is "provided" instead of "compile"?

I would like IntelliJ IDEA to have my libraries as "compile" scope instead of "provided" scope. This is a part of my gradle file:

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

The scope always reverts to "provided" in the dependency tab which is very annoying:

enter image description here

I am running: IntelliJ IDEA 2016.3.4 Build #IC-163.12024.16, built on January 31, 2017 JRE: 1.8.0_112-release-408-b6 x86_64

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It's a known issue in IntelliJ IDEA that is specific to Gradle 3.4:

It's already fixed in 2017.1 EAP build.

You can use Gradle 3.3 or older as a workaround until IDEA 2017.1 is released.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...