2017-02-24 5 views
10

私はIntelliJ IDEAにライブラリを "提供された"スコープの代わりに "コンパイル"スコープとして持たせたいと思います。これは私のGradleファイルの一部です:なぜintelliJ IDEA依存関係のスコープが「コンパイル」ではなく「提供」されていますか?

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

範囲は、常に非常に迷惑である依存関係]タブで、「提供」に戻ります:

enter image description here

私は実行しています: のIntelliJ IDEA 2016.3を0.4 ビルド#IC-163.12024.16、2017年1月31日 JREの上に構築された:1.8.0_112-リリース-408-B6 x86_64で

+0

参考:同様の問題が報告されました:https://youtrack.jetbrains.com/issue/IDEA-168710 –

答えて

14

それはGに固有のIntelliJ IDEAの既知の問題ですだというradle 3.4:

  • IDEA-167412のGradle 3.4-RC-1の変更はオプションとどのようにGradleの統合はのIntelliJ IDEA
で働く "ソースセットごとにモジュールの作成" に関する提供
  • original bug report in the Gradle project with more details
  • comment from the responsible developerへの依存関係をコンパイル

    これはすでに2017.1 EAP buildに修正されています。

    IDEA 2017.1がリリースされるまでは、回避策として3.3以降のGradleを使用できます。

  • 関連する問題