引用:Gradle依赖项学习总结,dependencies、transitive、force、exclude的使用与依赖冲突解决
统一加载gradle
的项目依赖
buildscript {
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url 'http://dl.bintray.com/jetbrains/intellij-plugin-service'
}
}
dependencies {
classpath "org.jetbrains.intellij.plugins:gradle-intellij-plugin:0.3.0-SNAPSHOT"
}
}
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'java'
intellij {
version 'IU-172.4155.36'
plugins = ['JavaScriptLanguage', 'CSS']
pluginName 'AJX_IDE_plugin'
}
添加的其他依赖库会有重复依赖的org.slf4j:slf4j-api:1.7.7
的包重复依赖
在build.gradle
中添加exclude
configurations {
all*.exclude group: 'org.slf4j'
}