开发者

when I use log4j 1.2.15, have errors in compile; when change to 1.2.16, everything is fine

When using log4j 1.2.15, I have some errors in downloading some o开发者_如何学JAVAther jars. When using log4j 1.2.16, everything is fine. Anyone know why?


oops, I've misread the question.

Updated answer

Seems like log4j 1.2.15 has weird dependencies on some of the other artifacts not available in public repository. So you get an error. Please exclude them. I would strongly suggest you to use Log4j v1.2.16. The following will do the job for v1.2.15:

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.15</version>
        <exclusions>
            <exclusion>
              <groupId>javax.mail</groupId>
              <artifactId>mail</artifactId>
            </exclusion>
            <exclusion>
              <groupId>javax.jms</groupId>
              <artifactId>jms</artifactId>
            </exclusion>
            <exclusion>
              <groupId>com.sun.jdmk</groupId>
              <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
              <groupId>com.sun.jmx</groupId>
              <artifactId>jmxri</artifactId>
            </exclusion>
          </exclusions>
    </dependency>

If you don't really want to exclude. Either manually download the dependencies and install locally or add the following repository:

 <repositories>
    ...
    <repository>
      <id>maven2-repository.dev.java.net</id>
      <name>Java.net Repository for Maven</name>
      <url>http://download.java.net/maven/2/</url>
      <layout>default</layout>
    </repository>
  </repositories>

Still, you will have to install jmxtools and jmxri. I do not think they are available either publicly or on Sun's maven repo.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜