I have a problem with updating Log4j versions. In my pom.xml
file I updated the version like this:
<properties>
// other stuff //
<org.apache.logging.log4j.version>2.16.0</org.apache.logging.log4j.version>
</properties>
But in the dependencies:
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>{org.apache.logging.log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>{org.apache.logging.log4j.version}</version>
</dependency>
The versions throw an error that it's override to 2.11.1 from a BOM file. Where can I update my pom
to import a 2.16.0 version BOM file?
CodePudding user response:
I guess you can try this to override spring-boot bom.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.16.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
... other dependencies including spring-boot-dependencies
</dependencies>
</dependencyManagement>
CodePudding user response:
NOT GOOD/no effect(maybe for log4j1):
<org.apache.logging.log4j.version>2.16.0</org.apache.logging.log4j.version>
Better
(for spring-boot-parent-based [2-2.6.1]/spring-dependeny-managed):
<log4j2.version>2.16.0</log4j2.version>
;)