第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

排除 Gradle 插件的傳遞依賴

排除 Gradle 插件的傳遞依賴

慕森王 2022-12-28 10:24:23
在 Gradle 中排除傳遞依賴非常簡單:compile('com.example.m:m:1.0') {      exclude group: 'org.unwanted', module: 'x'   }我們?nèi)绾谓鉀Q使用插件的情況:apply: "somePlugin"當(dāng)獲取依賴項時,我們意識到插件正在帶來一些它自己的傳遞依賴項?
查看完整描述

3 回答

?
當(dāng)年話下

TA貢獻(xiàn)1890條經(jīng)驗(yàn) 獲得超9個贊

您可以在應(yīng)用插件后刪除依賴項,(從單個配置或所有配置)使用例如。compile.exclude. 請注意,compile解析為“配置”;請參閱Configuration.exclude中的 javadoc 。


編輯


請注意,如果配置已經(jīng)解析,則排除依賴項可能會失敗。


示例腳本


apply plugin: 'java-library'


repositories {

    jcenter()

}


dependencies {

    compile 'junit:junit:4.12'

    compile 'ant:ant:1.6'

    compile 'org.apache.commons:commons-lang3:3.8'

}


// remove dependencies

configurations.all {

  exclude group:'junit', module:'junit'

}

configurations.compile {

  exclude group:'org.apache.commons', module: 'commons-lang3'

}


println 'compile deps:\n' + configurations.compile.asPath


查看完整回答
反對 回復(fù) 2022-12-28
?
江戶川亂折騰

TA貢獻(xiàn)1851條經(jīng)驗(yàn) 獲得超5個贊

您可以通過以下方式操作構(gòu)建腳本本身的類路徑:


buildscript {

    configurations {

        classpath {

            exclude group: 'org', module: 'foo' // For a global exclude

        }

    }

    dependencies {

        classpath('org:bar:1.0') {

            exclude group: 'org', module: 'baz' // For excluding baz from bar but not if brought elsewhere

        }

    }

}


查看完整回答
反對 回復(fù) 2022-12-28
?
四季花海

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超5個贊

這是強(qiáng)制您的項目嚴(yán)格使用特定版本的 build.gradle.kts 的另一種方法


val grpcVersion = "1.45.1"


implementation("io.grpc:grpc-stub") {

 version {

     strictly(grpcVersion)

   }

}


更多信息可以在 gradle 文檔中找到:https ://docs.gradle.org/current/userguide/dependency_downgrade_and_exclude.html


查看完整回答
反對 回復(fù) 2022-12-28
  • 3 回答
  • 0 關(guān)注
  • 262 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號