Maven dependency log4j error

eclipse, java, log4j, maven-2

Solution

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>

Problem

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/jmxtools-1.2.1.jar; error in opening zip file error: error reading /.m2/repository/com/sun/jmx/jmxri/1.2.1/jmxri-1.2.1.jar; error in opening zip file ``` I'm using this dependency : ``` <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> <scope>provided</scope> </dependency> ``` How can I fix this ?

Original source