【发布时间】:2018-11-22 06:37:29
【问题描述】:
我到处使用 gradle 和 latest.release 来混杂,但是,最近我的 Spring boot 应用程序停止从命令行运行。当我运行gradle clean bootRun 时,我得到...
线程“main”java.lang.IllegalArgumentException 中的异常:LoggerFactory 不是 Logback LoggerContext 但 Logback 在类路径上。删除 Logback 或竞争实现(从文件加载的类 org.slf4j.impl.Log4jLoggerFactory:/.../.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-log4j12/1.7.25/ 110cefe2df103412849d72ef7a67e4e91e4266b4/slf4j-log4j12-1.7.25.jar)。如果您使用的是 WebLogic,则需要将“org.slf4j”添加到 WEB-INF/weblogic.xml 中的首选应用程序包中:org.slf4j.impl.Log4jLoggerFactory
每个this post 我试过...
configurations.all {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
exclude group: 'org.springframework.boot', module: 'logback-classic'
exclude group: "org.slf4j"
}
这会消除 Logback 错误,但 spring 不会启动并且失败且没有错误。
原因:org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/bin/java'' 以非零退出完成值 1
我错过了什么?
【问题讨论】:
标签: spring-boot gradle