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' "結果不影響 添加依賴沒得問題