Filipp Gunbin created LOG4J2-2640:
-------------------------------------

             Summary: Circular dependency in pom.xml
                 Key: LOG4J2-2640
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2640
             Project: Log4j 2
          Issue Type: Bug
            Reporter: Filipp Gunbin


Master fails to build unless current log4j-core version is already present in 
local maven repo:

{quote}[ERROR] Failed to execute goal on project log4j-core: Could not resolve 
dependencies for project 
org.apache.logging.log4j:log4j-core:jar:3.0.0-SNAPSHOT: Could not find artifact 
org.apache.logging.log4j:log4j-core:jar:3.0.0-SNAPSHOT, try downloading from 
https://logging.apache.org/log4j/2.x/download.html -> [Help 1]
{quote}

This is because log4j-core has this dependency, which itself references 
log4j-core (with a defined version which gets correctly overriden by 
3.0.0-SNAPSHOT).

 {{   <dependency>
      <groupId>com.github.ivandzf</groupId>
      <artifactId>log4j2-custom-layout</artifactId>
      <version>1.1.0</version>
      <scope>test</scope>
    </dependency>
}}

Simplest fix is to add exclusion:

{{diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index 20063be15..2e15ca9a4 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -324,6 +324,12 @@
       <artifactId>log4j2-custom-layout</artifactId>
       <version>1.1.0</version>
       <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.logging.log4j</groupId>
+          <artifactId>log4j-core</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
   </dependencies>
   <build>
}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to