Log4j2 Java unable to import org.apache.logging.log4j.core

Viewed 5295

I am trying to use the Log4j2 API to write a Converter plugin with version 2.8.2 but am unable to import org.apache.logging.log4j.core to import the following:

org.apache.logging.log4j.core.LogEvent, org.apache.logging.log4j.core.config.plugins.Plugin, org.apache.logging.log4j.core.pattern.*

I have added the maven dependencies as and this works fine with Log4j 2.8.1

<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-core</artifactId>
  <version>2.8.2</version>
</dependency>
<dependency>
   <groupId>org.apache.logging.log4j</groupId>
   <artifactId>log4j-api</artifactId>
   <version>2.8.2</version>
</dependency>

Update: log4j-core-2.8.2.jar content

enter image description here

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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>com.andrew_flower.test</groupId>
    <artifactId>logtest1</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.8.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.8.2</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.9</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>central</id>
            <url>http://repo1.maven.org/maven2/</url>
        </repository>
        <repository>
            <id>apache.snapshots</id>
            <name>Apache Release Distribution Repository</name>
            <url>
                http://repository.apache.org/snapshots
            </url>
        </repository>
    </repositories>
</project>
1 Answers
Related