configurations {
compile.exclude module: 'spring-boot-starter-logging'//排除对默认logging的依赖
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile("org.springframework.boot:spring-boot-starter-web:1.4.0.RELEASE")
//添加对log4j starter的依赖。
compile("org.springframework.boot:spring-boot-starter-log4j:1.3.7.RELEASE")
}
或者
我用第二种时 'exclude'单词报"can't resolve symbol 'exclude' "结果不影响 添加依赖没得问题