log4j java.lang.NoSuchMethodError:()将所有的日志文件都保存在一个文件夹中,

nszi6y05  于 2022-11-06  发布在  Java
关注(0)|答案(1)|浏览(125)

我有:

<dependencies>

        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml -->
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
            <version>2.13.2</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.module/jackson-module-jaxb-annotations -->
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-jaxb-annotations</artifactId>
            <version>2.13.2</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>5.2.2</version>
        </dependency>

        <dependency>
            <groupId>com.company.commons</groupId>
            <artifactId>commons-batch</artifactId>
            <version>${company.commons.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>1.8</version>
        </dependency>

        <dependency>
            <groupId>com.company.project</groupId>
            <artifactId>project-domain</artifactId>
            <version>0.1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>

company-commons中我有:

<dependencies>
        <dependency>
            <groupId>com.company.commons</groupId>
            <artifactId>company-domain</artifactId>
            <version>2.9.0-SNAPSHOT</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-quartz -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-quartz</artifactId>
            <version>${spring.boot.version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-batch -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-batch</artifactId>
            <version>${spring.boot.version}</version>
        </dependency>
</dependencies>

company-domain中,我有:

<dependencies>

        <!-- https://mvnrepository.com/artifact/org.zalando/problem-spring-web-starter -->
        <dependency>
            <groupId>org.zalando</groupId>
            <artifactId>problem-spring-web</artifactId>
            <version>0.27.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>31.0.1-jre</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.9.3</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jdbc -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
            <version>${spring.boot.version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-integration -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-integration</artifactId>
            <version>${spring.boot.version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-actuator -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <version>${spring.boot.version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-crypto -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-crypto</artifactId>
            <version>4.2.2.RELEASE</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>${spring.boot.version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/commons-net/commons-net -->
        <dependency>
            <groupId>commons-net</groupId>
            <artifactId>commons-net</artifactId>
            <version>3.6</version>
        </dependency>

    </dependencies>

${spring.boot.version}就是2.2.0.RELEASE
在Sping Boot 应用程序和以下片段中:

final InputStream stream = new URL(url).openStream();
final Workbook workbook = new HSSFWorkbook(stream);

失败,并显示:

java.lang.NoSuchMethodError: org.apache.logging.log4j.Logger.atDebug()Lorg/apache/logging/log4j/LogBuilder;
    at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.parseRelationshipsPart(PackageRelationshipCollection.java:309)
    at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.<init>(PackageRelationshipCollection.java:160)
    at org.apache.poi.openxml4j.opc.PackageRelationshipCollection.<init>(PackageRelationshipCollection.java:130)
    at org.apache.poi.openxml4j.opc.PackagePart.loadRelationships(PackagePart.java:565)
    at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:745)
    at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:315)
    at org.apache.poi.ooxml.util.PackageHelper.open(PackageHelper.java:59)
    at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:289)
    at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:285)
    at com.company.project.MyParser.parse(MyParser.java:35)
    at com.company.project.MyReader.process(MyReader.java:44)
    at com.company.project.MySlaveStepReader.open(MySlaveStepReader.java:60)
    at com.company.project.MySlaveStepReader$$FastClassBySpringCGLIB$$d02f818a.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
    at com.company.project.MySlaveStepReader$$EnhancerBySpringCGLIB$$e46cbc57.open(<generated>)
    at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:103)
    at org.springframework.batch.core.step.item.ChunkMonitor.open(ChunkMonitor.java:114)
    at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:103)
    at org.springframework.batch.core.step.tasklet.TaskletStep.open(TaskletStep.java:311)
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:205)
    at jdk.internal.reflect.GeneratedMethodAccessor223.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
    at com.sun.proxy.$Proxy121.execute(Unknown Source)
    at org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler$1.call(TaskExecutorPartitionHandler.java:138)
    at org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler$1.call(TaskExecutorPartitionHandler.java:135)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
    at org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler.doHandle(TaskExecutorPartitionHandler.java:103)
    at org.springframework.batch.core.partition.support.AbstractPartitionHandler.handle(AbstractPartitionHandler.java:61)
    at org.springframework.batch.core.partition.support.PartitionStep.doExecute(PartitionStep.java:106)
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:208)
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
    at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:68)
    at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:68)
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169)
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144)
    at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:137)
    at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:319)
    at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:147)
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
    at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:140)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
    at com.sun.proxy.$Proxy114.run(Unknown Source)
    at com.company.project.MyTaskLauncher$MyTaskLauncherBean.executeInternal(MyTaskLauncher.java:71)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

mvn dependency:tree的输出为:

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ project-batch ---
[INFO] com.company.project:project-batch:jar:0.1.0-SNAPSHOT
[INFO] +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.13.2:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-core:jar:2.13.2:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.2:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.2:compile
[INFO] |  +- org.codehaus.woodstox:stax2-api:jar:4.2.1:compile
[INFO] |  \- com.fasterxml.woodstox:woodstox-core:jar:6.2.7:compile
[INFO] +- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.13.2:compile
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] |  \- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[INFO] +- org.apache.poi:poi:jar:5.2.2:compile
[INFO] |  +- commons-codec:commons-codec:jar:1.15:compile
[INFO] |  +- org.apache.commons:commons-collections4:jar:4.4:compile
[INFO] |  +- org.apache.commons:commons-math3:jar:3.6.1:compile
[INFO] |  +- commons-io:commons-io:jar:2.11.0:compile
[INFO] |  +- com.zaxxer:SparseBitSet:jar:1.2:compile
[INFO] |  \- org.apache.logging.log4j:log4j-api:jar:2.17.2:compile
[INFO] +- com.company.commons:commons-batch:jar:2.9.0-SNAPSHOT:compile
[INFO] |  +- com.company.commons:commons-domain:jar:2.9.0-SNAPSHOT:compile
[INFO] |  |  +- org.zalando:problem-spring-web:jar:0.27.0:compile
[INFO] |  |  |  +- org.zalando:problem-violations:jar:0.27.0:compile
[INFO] |  |  |  +- org.zalando:problem-spring-common:jar:0.27.0:compile
[INFO] |  |  |  +- org.apiguardian:apiguardian-api:jar:1.1.2:compile
[INFO] |  |  |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  |  |  +- org.slf4j:slf4j-api:jar:1.7.32:compile
[INFO] |  |  |  +- org.zalando:problem:jar:0.26.0:compile
[INFO] |  |  |  +- org.zalando:jackson-datatype-problem:jar:0.26.0:compile
[INFO] |  |  |  +- org.zalando:faux-pas:jar:0.9.0:compile
[INFO] |  |  |  \- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] |  |  +- com.google.guava:guava:jar:31.0.1-jre:compile
[INFO] |  |  |  +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] |  |  |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] |  |  |  +- org.checkerframework:checker-qual:jar:3.12.0:compile
[INFO] |  |  |  +- com.google.errorprone:error_prone_annotations:jar:2.7.1:compile
[INFO] |  |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.9.3:compile
[INFO] |  |  |  +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  |  |  \- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  +- com.zaxxer:HikariCP:jar:3.4.1:compile
[INFO] |  |  |  \- org.springframework:spring-jdbc:jar:5.2.0.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-integration:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  \- org.springframework.integration:spring-integration-core:jar:5.2.0.RELEASE:compile
[INFO] |  |  |     +- io.projectreactor:reactor-core:jar:3.3.0.RELEASE:compile
[INFO] |  |  |     |  \- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] |  |  |     +- org.springframework.retry:spring-retry:jar:1.2.4.RELEASE:compile
[INFO] |  |  |     \- org.springframework:spring-messaging:jar:5.2.0.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-actuator:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  |  \- org.springframework.boot:spring-boot-actuator:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  \- io.micrometer:micrometer-core:jar:1.3.0:compile
[INFO] |  |  |     +- org.hdrhistogram:HdrHistogram:jar:2.1.11:compile
[INFO] |  |  |     \- org.latencyutils:LatencyUtils:jar:2.0.3:compile
[INFO] |  |  +- org.springframework.security:spring-security-crypto:jar:4.2.2.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  +- jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile
[INFO] |  |  |  +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
[INFO] |  |  |  +- org.hibernate:hibernate-core:jar:5.4.6.Final:compile
[INFO] |  |  |  |  +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] |  |  |  |  +- org.javassist:javassist:jar:3.24.0-GA:compile
[INFO] |  |  |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  |  |  +- org.jboss:jandex:jar:2.0.5.Final:compile
[INFO] |  |  |  |  +- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] |  |  |  |  +- org.dom4j:dom4j:jar:2.1.1:compile
[INFO] |  |  |  |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:compile
[INFO] |  |  |  |  \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.1:compile
[INFO] |  |  |  |     +- org.glassfish.jaxb:txw2:jar:2.3.1:compile
[INFO] |  |  |  |     +- com.sun.istack:istack-commons-runtime:jar:3.0.7:compile
[INFO] |  |  |  |     +- org.jvnet.staxex:stax-ex:jar:1.8:compile
[INFO] |  |  |  |     \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.15:compile
[INFO] |  |  |  +- org.springframework.data:spring-data-jpa:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  |  +- org.springframework.data:spring-data-commons:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  |  \- org.springframework:spring-orm:jar:5.2.0.RELEASE:compile
[INFO] |  |  |  \- org.springframework:spring-aspects:jar:5.2.0.RELEASE:compile
[INFO] |  |  \- commons-net:commons-net:jar:3.6:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-quartz:jar:2.2.0.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  +- org.springframework.boot:spring-boot:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  |  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] |  |  |  |  |  \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] |  |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.12.1:compile
[INFO] |  |  |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.28:compile
[INFO] |  |  |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  |  |  \- org.yaml:snakeyaml:jar:1.25:runtime
[INFO] |  |  +- org.springframework:spring-context-support:jar:5.2.0.RELEASE:compile
[INFO] |  |  |  +- org.springframework:spring-beans:jar:5.2.0.RELEASE:compile
[INFO] |  |  |  \- org.springframework:spring-context:jar:5.2.0.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-tx:jar:5.2.0.RELEASE:compile
[INFO] |  |  \- org.quartz-scheduler:quartz:jar:2.3.1:compile
[INFO] |  |     \- com.mchange:mchange-commons-java:jar:0.2.15:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-batch:jar:2.2.0.RELEASE:compile
[INFO] |  |  \- org.springframework.batch:spring-batch-core:jar:4.2.0.RELEASE:compile
[INFO] |  |     +- javax.batch:javax.batch-api:jar:1.0:compile
[INFO] |  |     +- org.codehaus.jettison:jettison:jar:1.2:compile
[INFO] |  |     \- org.springframework.batch:spring-batch-infrastructure:jar:4.2.0.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-web:jar:2.2.0.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-json:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.10.0:compile
[INFO] |  |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.10.0:compile
[INFO] |  |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.10.0:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.27:compile
[INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.27:compile
[INFO] |  |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.27:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-validation:jar:2.2.0.RELEASE:compile
[INFO] |  |  |  +- jakarta.validation:jakarta.validation-api:jar:2.0.1:compile
[INFO] |  |  |  \- org.hibernate.validator:hibernate-validator:jar:6.0.17.Final:compile
[INFO] |  |  +- org.springframework:spring-web:jar:5.2.0.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-webmvc:jar:5.2.0.RELEASE:compile
[INFO] |  |     \- org.springframework:spring-expression:jar:5.2.0.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-test:jar:2.2.0.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-test:jar:2.2.0.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.2.0.RELEASE:compile
[INFO] |  |  +- com.jayway.jsonpath:json-path:jar:2.4.0:compile
[INFO] |  |  |  \- net.minidev:json-smart:jar:2.3:compile
[INFO] |  |  |     \- net.minidev:accessors-smart:jar:1.2:compile
[INFO] |  |  |        \- org.ow2.asm:asm:jar:5.0.4:compile
[INFO] |  |  +- org.junit.jupiter:junit-jupiter:jar:5.5.2:compile
[INFO] |  |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.5.2:compile
[INFO] |  |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:compile
[INFO] |  |  |  |  \- org.junit.platform:junit-platform-commons:jar:1.5.2:compile
[INFO] |  |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.5.2:compile
[INFO] |  |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.5.2:runtime
[INFO] |  |  +- org.junit.vintage:junit-vintage-engine:jar:5.5.2:compile
[INFO] |  |  |  +- org.junit.platform:junit-platform-engine:jar:1.5.2:compile
[INFO] |  |  |  \- junit:junit:jar:4.12:compile
[INFO] |  |  +- org.mockito:mockito-junit-jupiter:jar:3.1.0:compile
[INFO] |  |  +- org.assertj:assertj-core:jar:3.13.2:compile
[INFO] |  |  +- org.hamcrest:hamcrest:jar:2.1:compile
[INFO] |  |  +- org.mockito:mockito-core:jar:3.1.0:compile
[INFO] |  |  |  +- net.bytebuddy:byte-buddy:jar:1.9.10:compile
[INFO] |  |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.9.10:compile
[INFO] |  |  |  \- org.objenesis:objenesis:jar:2.6:compile
[INFO] |  |  +- org.skyscreamer:jsonassert:jar:1.5.0:compile
[INFO] |  |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:compile
[INFO] |  |  +- org.springframework:spring-core:jar:5.2.0.RELEASE:compile
[INFO] |  |  |  \- org.springframework:spring-jcl:jar:5.2.0.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-test:jar:5.2.0.RELEASE:compile
[INFO] |  |  \- org.xmlunit:xmlunit-core:jar:2.6.3:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-cache:jar:2.2.0.RELEASE:compile
[INFO] |  \- org.springframework.boot:spring-boot-starter-aop:jar:2.2.0.RELEASE:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.2.0.RELEASE:compile
[INFO] |     \- org.aspectj:aspectjweaver:jar:1.9.4:compile
[INFO] +- org.apache.commons:commons-csv:jar:1.8:compile
[INFO] +- com.company.project:project-domain:jar:0.1.0-SNAPSHOT:compile
[INFO] \- org.projectlombok:lombok:jar:1.18.22:provided

here所述的解决方案和使用版本没有产生任何结果。
我错过了什么?

42fyovps

42fyovps1#

spring-boot-starter版本2.2.0依赖项将log4j相关依赖项与2.12.1版本相关联,而2.12.1版本没有atDebug()方法。因此:

<dependencyManagement>
        <dependencies>
            <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-to-slf4j -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-to-slf4j</artifactId>
                <version>2.17.2</version>
            </dependency>

            <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>2.17.2</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

已解决此问题。

相关问题