【发布时间】:2020-06-07 06:46:28
【问题描述】:
我正在为 intelliJ IDEA 开发一个插件,并且我正在使用一个外部库。 当我运行时,我遇到了这个问题。
SLF4J:类路径包含多个 SLF4J 绑定。 SLF4J:在 [jar:file:/C:/Users/molos/Desktop/Thesis-folder/Thesis-project/build/idea-sandbox/plugins/Thesis-project/lib/slf4j-log4j12-1.6.0 中找到绑定。 jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J:在 [jar:file:/C:/Users/molos/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2019.3.1/52292e4f8a0ccb3ceb08bd81fd57b88923ac8e99/ideaIC-2019.3 中找到绑定.1/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J:请参阅http://www.slf4j.org/codes.html#multiple_bindings 以获得解释。
这是我的 build.gradle。
plugins {
id 'java'
id 'maven-publish'
id 'org.jetbrains.intellij' version '0.4.10'
}
version '1.0-SNAPSHOT'
apply plugin: 'maven'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven {
url = 'https://repo.maven.apache.org/maven2'
}
dependencies {
// https://mvnrepository.com/artifact/com.github.mauricioaniche/ck
compile group: 'com.github.mauricioaniche', name: 'ck', version: '0.4.4'
// https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit
compile group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '2.2.0.201212191850-r'
// https://mvnrepository.com/artifact/org.apache.commons/commons-csv
compile group: 'org.apache.commons', name: 'commons-csv', version: '1.1'
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version '2019.3.1'
}
我尝试了我找到的许多解决方案,但我无法解决。
有人可以帮我吗?
【问题讨论】:
-
您是否尝试过清除 m2 文件夹并重新安装您的依赖项?如果你这样做了但仍然发现同样的问题,那么有一些依赖项正在下载 SLF4J 作为横向依赖项,如果你可以发布你的
pom.xml文件,可能我或其他人可以帮助你。 -
我试图清理 m2 文件夹和其他想法文件夹。我用 build.gradle 编辑帖子
-
我会尝试从其他依赖项中搜索 slf4j 依赖项。您应该将它从其他依赖项中排除,然后自己在 build.gradle 中添加一个。我推荐的另一件事是使用 force 命令。看这里docs.gradle.org/current/dsl/…
-
我以为它是 maven 构建...我的坏事没有必要清除
.m2尝试 clearing gradle cache
标签: java gradle intellij-idea slf4j intellij-plugin