Missing artifact log4j: log4j: bundle: 1.2.17

I created a dynamic web application in eclipse Version: Kepler Service Release 1 using the menu. After that, I converted it to a maven project using configure -> convert to maven project. Then I did maven-> Add a dependency, and then search log4j.

After adding that when hovering over the tag for log4j it displays the missing artifact log4j: log4j: bundle: 1.2.17. I cannot update dependencies using maven. How to fix it? Also explain the cause of the error.

Here is the generated xml after adding log4j.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>Healthcare</groupId> <artifactId>Healthcare</artifactId> <version>0.0.1-HEALTHCARE</version> <packaging>war</packaging> <build> <sourceDirectory>src</sourceDirectory> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.3</version> <configuration> <warSourceDirectory>WebContent</warSourceDirectory> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> <type>bundle</type> </dependency> </dependencies> </project> 
+6
source share
4 answers

First, why did you change the location of the default source folder? By default, src/main/java and for webapp src/main/webapp . In addition, there is no bundle for log4j on Maven Central, just remove the <type>bundle</type> from your dependency, only the jar can be used in Maven Central.

+6
source

I always do the following trick:

In dependency management, I change the properties of the dependencies (I select the dependencies with the problem and click the properties button), changing the type associated with the bank, and fixes the problem.

Well, I hope this solution will work for you :),

+3
source

Check for dependencies or missing.

 <properties> <springframework.version>4.2.1.RELEASE</springframework.version> <jackson.version>2.5.3</jackson.version> <log4j.version>1.2.17</log4j.version> </properties> 
0
source

By default (and normal use), Maven will use banks as a dependency. Just change the package to jar in your pom.xml file in this dependency, which gives you an error.

0
source

All Articles