jan
jan

Reputation: 4063

Loading log4j from maven repository

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.

Upvotes: 0

Views: 1164

Answers (1)

willome
willome

Reputation: 3152

That is normal : on bottom of your screenshot you can see that you added log4j-2.0-beta6.pom. That is a pom dependecy (the pom parent which 'describes' log4j.2). So you should add an other dependecy instead : probably log4j-api (I am not sure I have never tried log4j2)

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-1.2-api</artifactId>
  <version>2.0-beta6</version>
</dependency>

Upvotes: 2

Related Questions