我正在使用 Gradle 開發一個專案,我在 build.gradle 檔案中有以下內容:
repositories {
mavenCentral()
}
我想知道這個匯入是什么版本的 Apache Commons Codec。(關于 mavenCentral() 的更多資訊在這里)
問題不在于我如何找到版本(我的是 1.11),而是默認選擇特定版本背后的邏輯是什么。
uj5u.com熱心網友回復:
所以你有一個像這樣的gradle檔案:
plugins {
id 'java'
}
dependencies {
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.0'
implementation group: 'commons-validator', name: 'commons-validator', version: '1.7'
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13'
}
repositories {
mavenCentral()
}
如果您想知道總共包含哪些依賴項以及為什么,那么您可以執行gradle dependencies它,它會向您展示)此圖:
compileClasspath - Compile classpath for source set 'main'.
--- org.apache.commons:commons-lang3:3.0
--- commons-validator:commons-validator:1.7
| --- commons-beanutils:commons-beanutils:1.9.4
| | --- commons-logging:commons-logging:1.2
| | \--- commons-collections:commons-collections:3.2.2
| --- commons-digester:commons-digester:2.1
| --- commons-logging:commons-logging:1.2
| \--- commons-collections:commons-collections:3.2.2
\--- org.apache.httpcomponents:httpclient:4.5.13
--- org.apache.httpcomponents:httpcore:4.4.13
--- commons-logging:commons-logging:1.2
\--- commons-codec:commons-codec:1.11
此圖顯示org.apache.httpcomponents:httpclient:4.5.13(您在依賴項中明確提及)依賴commons-codec:commons-codec:1.11并因此commons-codec:commons-codec:1.11也包含在您的專案中。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/374987.html
標籤:爪哇 等级 存储库 版本 maven-central
