0

I'm new to maven and i am currently trying to load the log4j jar (i am also using eclipse) with maven. If i search for "org.apache.log4" e.g. i find this entries:

enter image description here

But if i add the selected one, it is added to my pom.xml, but no jar is downloaded. I also tried some other ones but i can not find the correct one. What am i doing wrong here?

Other dependencies like hibernate work fine for me.

4

1 回答 1

2

这是正常的:在您的屏幕截图底部,您可以看到您添加了log4j-2.0-beta6.pom。那是一个pom dependecy(“描述”log4j.2的pom父级)。因此,您应该添加其他依赖项:可能log4j-api(我不确定我从未尝试过 log4j2)

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-1.2-api</artifactId>
  <version>2.0-beta6</version>
</dependency>
于 2013-05-22T15:18:11.657 回答