0

我从事两个项目: 1. 第一个项目:

<groupId>org.abc</groupId>
<artifactId>db-manager</artifactId>
<version>18.11.1</version>
<packaging>jar</packaging>
  1. 第二个项目:

    org.abc 数据提取器 18.11.2 jar

两者都有这些依赖关系:

<dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.25</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.3</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

第二个项目将第一个项目作为依赖项:

<dependency>
            <groupId>org.abc</groupId>
            <artifactId>db-manager</artifactId>
            <version>18.11.1</version>
            <exclusions>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

但是当我运行代码时,我收到了这条消息:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/<myPath>/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/<myPath>/.m2/repository/org/abc/db-manager/18.11.1/db-manager-18.11.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
12:58:22,338 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
12:58:22,339 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
12:58:22,339 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/Users/<my_path>/.m2/repository/org/abc/db-manager/18.11.1/db-manager-18.11.1.jar!/logback.xml]
12:58:22,340 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
12:58:22,340 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/<my_path>/.m2/repository/org/abc/data-model/18.11.2/data-model-18.11.2.jar!/logback.xml]
12:58:22,340 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/C:/Users/<my_path>/.m2/repository/org/abc/db-manager/18.11.1/db-manager-18.11.1.jar!/logback.xml]
12:58:22,365 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@735b5592 - URL [jar:file:/C:/Users/<my_path>/.m2/repository/org/abc/db-manager/18.11.1/db-manager-18.11.1.jar!/logback.xml] is not of type file
12:58:22,435 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
12:58:22,437 |-INFO in ch.qos.logback.classic.joran.action.LoggerContextListenerAction - Adding LoggerContextListener of type [ch.qos.logback.classic.jul.LevelChangePropagator] to the object stack
12:58:22,449 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@58651fd0 - Propagating DEBUG level on Logger[ROOT] onto the JUL framework
12:58:22,449 |-INFO in ch.qos.logback.classic.joran.action.LoggerContextListenerAction - Starting LoggerContextListener
12:58:22,449 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
12:58:22,452 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [console]
12:58:22,454 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
12:58:22,506 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.abc] to DEBUG
12:58:22,506 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@58651fd0 - Propagating DEBUG level on Logger[com.abc] onto the JUL framework
12:58:22,506 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache.maven] to DEBUG
12:58:22,506 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@58651fd0 - Propagating DEBUG level on Logger[org.apache.maven] onto the JUL framework
12:58:22,506 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.github.dockerjava] to INFO
12:58:22,506 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@58651fd0 - Propagating INFO level on Logger[com.github.dockerjava] onto the JUL framework
12:58:22,506 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [httpclient] to ERROR
12:58:22,506 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@58651fd0 - Propagating ERROR level on Logger[httpclient] onto the JUL framework
12:58:22,506 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [java] to ERROR
12:58:22,506 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@58651fd0 - Propagating ERROR level on Logger[java] onto the JUL framework
12:58:22,506 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.apache] to ERROR
12:58:22,506 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@58651fd0 - Propagating ERROR level on Logger[org.apache] onto the JUL framework
12:58:22,506 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.aragost.javahg.log.JULLogger] to ERROR
12:58:22,506 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@58651fd0 - Propagating ERROR level on Logger[com.aragost.javahg.log.JULLogger] onto the JUL framework
12:58:22,507 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [console] to Logger[ROOT]
12:58:22,507 |-INFO in 

ch.qos.logback.classic.joran.action.ConfigurationAction - 配置结束。12:58:22,509 |-CH.qos.logback.classic.joran.JoranConfigurator@4520ebad 中的信息 - 将当前配置注册为安全回退点

SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

我添加了排除,但仍然存在一些冲突,知道如何解决这个问题吗?

4

0 回答 0