You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2023/01/14 05:36:55 UTC

[logging-log4j2] branch release-2.x updated: (doc) Use Gradle platform to import Log4j BOM in Gradle 5.0+

This is an automated email from the ASF dual-hosted git repository.

mattsicker pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/release-2.x by this push:
     new 05fa24125c (doc) Use Gradle platform to import Log4j BOM in Gradle 5.0+
     new 2df18f2926 Merge pull request #1141 from grossws/docs-gradle
05fa24125c is described below

commit 05fa24125c7d31d07e2716cb95b400226abe64d6
Author: Konstantin Gribov <gr...@gmail.com>
AuthorDate: Mon Nov 14 18:35:10 2022 +0300

    (doc) Use Gradle platform to import Log4j BOM in Gradle 5.0+
---
 src/site/markdown/maven-artifacts.md.vm | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/site/markdown/maven-artifacts.md.vm b/src/site/markdown/maven-artifacts.md.vm
index aed9577ab5..055f68d425 100644
--- a/src/site/markdown/maven-artifacts.md.vm
+++ b/src/site/markdown/maven-artifacts.md.vm
@@ -149,14 +149,29 @@ file. When you specify the version identifier in this section, you don't have to
 </dependencyManagement>
 ```
 
-To use this with Gradle, an additional [Gradle plugin](https://github.com/spring-gradle-plugins/dependency-management-plugin)
+Gradle 5.0+ supports importing Maven BOM as a [platform](https://docs.gradle.org/current/userguide/platforms.html#sub:bom_import)
+to align dependency versions.
+
+`build.gradle`
+
+```
+dependencies {
+  implementation platform('org.apache.logging.log4j:log4j-bom:${Log4jReleaseVersion}')
+
+  implementation 'org.apache.logging.log4j:log4j-api'
+  runtimeOnly 'org.apache.logging.log4j:log4j-core'
+  // etc.
+}
+```
+
+To use this with Gradle 2.8-4.10, an additional [Gradle plugin](https://github.com/spring-gradle-plugins/dependency-management-plugin)
 is required for dependency management functionality.
 
 `build.gradle`
 
 ```
 plugins {
-  id 'io.spring.dependency-management' version '1.0.1.RELEASE'
+  id 'io.spring.dependency-management' version '1.0.15.RELEASE'
 }
 
 dependencyManagement {
@@ -166,8 +181,9 @@ dependencyManagement {
 }
 
 dependencies {
+  // For Gradle 2.8-3.3 use compile/runtime instead of implementation/runtimeOnly
   implementation 'org.apache.logging.log4j:log4j-api'
-  implementation 'org.apache.logging.log4j:log4j-core'
+  runtimeOnly 'org.apache.logging.log4j:log4j-core'
   // etc.
 }
 ```