Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I add apache commons logging using the maven2 with eclipse?

I can't seem to find apache common logging when using eclipse w/maven2 plugin.

I need it for spring3 mvc apparently.

like image 238
Blankman Avatar asked Feb 11 '10 00:02

Blankman


People also ask

How do I add Org Apache Commons to eclipse?

Eclipse -> Preferences: Java - Build path - User Libraries push the "New..." button, and in the "User library name:" enter 'appache-commons-lang'. Click to select "appache-commons-lang" in the "Defined user libraries" list and then click on the "Add JARs..." button and browse for commons-lang-2.5.

How do I add a Maven dependency in Eclipse?

Via the Maven index, you can search for dependencies, select them and add them to your pom file. To download the index, select Windows > Preferences > Maven and enable the Download repository index updates on startup option. After changing this setting, restart Eclipse. This triggers the download of the Maven index.

Does Maven work with Eclipse?

Using Maven with the Eclipse IDEThe Eclipse IDE provides support for the Maven build. This support is developed in the M2Eclipse project. It provides an editor for modifying the pom file and downloads dependencies if required. It also manages the classpath of the projects in the IDE.

How do you do common logging in Java?

We need to have the commons-logging. properties in our src folder. The above property tells the Commons Library as to which Logger Class, the application intends to use. Then, we need to set up the corresponding library, Log4J in this case.


1 Answers

Do you know that the m2eclipse plugin can search some indexed repositories, like central? For example, if you right-click on your project and go to Maven > Add Dependency, you can use it like this:

alt text

And this will add this to your pom:

<dependency>
  <groupId>commons-logging</groupId>
  <artifactId>commons-logging</artifactId>
  <version>1.1.1</version>
</dependency>

Another option is to use one of the numerous repository search engine, for example:

http://search.maven.org/#artifactdetails|commons-logging|commons-logging|1.1.1|jar

like image 68
Pascal Thivent Avatar answered Oct 09 '22 07:10

Pascal Thivent