Maven dependency log4j error

前端 未结 2 2007
猫巷女王i
猫巷女王i 2021-02-13 22:18

Hello everyone I have error which breaks up my build for no reason, here is the error message :

error: error reading
/.m2/repository/com/sun/jdmk/jmxtools/1.2.1/         


        
相关标签:
2条回答
  • 2021-02-13 22:51

    You most likely don't need jmxtools or jmxri, so you can probably exclude them from your dependencies:

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.15</version>
        <scope>provided</scope>
        <exclusions>
            <exclusion>
              <groupId>com.sun.jdmk</groupId>
              <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
              <groupId>com.sun.jmx</groupId>
              <artifactId>jmxri</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    
    0 讨论(0)
  • 2021-02-13 22:53

    Seriously, these dependencies on JMX, JMS, Java Mail are ridiculous and having to deal with exclusions to do some logging makes me speechless. So, I'd rather use the previous version of log4j (1.2.14) or just switch to logback.

    0 讨论(0)
提交回复
热议问题