kafka源码阅读环境搭建
build.gradle添加implementation libs.slf4jApi
报以下错,解决方案:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
在build.gradle的子项目core中需要添加这两个依赖:
project(':core') {
println "Building project 'core' with Scala version ${versions.scala}"
...
dependencies {
...
// 添加以下两个依赖
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'
}