gradle默認版本衝突解決策略:自動依賴最高版本jar包api
修改默認解決策略,使之出現版本錯誤時報錯gradle
configurations.all{ resolutionStrategy{ failOnVersionConflict() } }
一、查看版本衝突spa
執行 dependencies 任務 查看詳細的依賴hibernate
二、解決衝突3d
(1)排除傳遞性依賴code
compile('org.hibernate:hibernate-core:3.6.3.Final'){ exclude group:"org.slf4j",module:"slf4j-api" //transitive = false }
(2)強制指定版本blog
configurations.all{ resolutionStrategy{ force'org.slf4j:slf4j-api:1.7.24' } }