Skip to content

Commit 320e3dc

Browse files
hankemcodecholeric
authored andcommitted
consolidate test dependencies for logging
To provide an SLF4J implementation to all tests, `dependency.log4j_slf4j` (with the implementation of `org.apache.logging.slf4j.SLF4JServiceProvider` picked up at runtime by the ServiceLoader) is moved to the `archunit.java-testing-conventions` plugin. It transitively depends on `dependency.log4j_core` / `dependency.log4j_api`, which are only needed as explicit implementation dependencies in modules that specifically test logs. Signed-off-by: Manfred Hanke <[email protected]>
1 parent 74f7a27 commit 320e3dc

File tree

10 files changed

+1
-21
lines changed

10 files changed

+1
-21
lines changed

archunit-3rd-party-test/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dependencies {
99
testImplementation project(path: ':archunit', configuration: 'tests')
1010
testImplementation dependency.springBootLoader
1111
dependency.addGuava { dependencyNotation, config -> testImplementation(dependencyNotation, config) }
12-
testImplementation dependency.log4j_slf4j
1312
testImplementation dependency.junit4
1413
testImplementation dependency.junit_dataprovider
1514
testImplementation dependency.assertj

archunit-example/example-junit4/build.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ ext.moduleName = 'com.tngtech.archunit.example.junit4'
77
dependencies {
88
testImplementation project(path: ':archunit-junit4')
99
testImplementation project(path: ':archunit-example:example-plain')
10-
11-
testRuntimeOnly dependency.log4j_api
12-
testRuntimeOnly dependency.log4j_core
13-
testRuntimeOnly dependency.log4j_slf4j
1410
}
1511

1612
test {

archunit-example/example-junit5/build.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ ext.minimumJavaVersion = JavaVersion.VERSION_1_8
88
dependencies {
99
testImplementation project(path: ':archunit-junit5')
1010
testImplementation project(path: ':archunit-example:example-plain')
11-
12-
testRuntimeOnly dependency.log4j_api
13-
testRuntimeOnly dependency.log4j_core
14-
testRuntimeOnly dependency.log4j_slf4j
1511
}
1612

1713
test {

archunit-integration-test/build.gradle

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ ext.minimumJavaVersion = JavaVersion.VERSION_1_8
99
dependencies {
1010
testImplementation dependency.junitPlatform
1111
testImplementation dependency.assertj
12-
testImplementation dependency.log4j_api
13-
testImplementation dependency.log4j_core
14-
testImplementation dependency.log4j_slf4j
1512
testImplementation project(path: ':archunit', configuration: 'tests')
1613
testImplementation project(path: ':archunit-junit4')
1714
testImplementation project(path: ':archunit-junit5-api')

archunit-java-modules-test/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ ext.minimumJavaVersion = JavaVersion.VERSION_1_9
99

1010
dependencies {
1111
testImplementation project(path: ':archunit', configuration: 'shadow')
12-
testImplementation dependency.log4j_slf4j
1312
}
1413

1514
def addArchUnitModuleOptions = {

archunit-junit/build.gradle

-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ dependencies {
3838
dependency.addGuava { dependencyNotation, config -> implementation(dependencyNotation, config) }
3939
implementation dependency.slf4j
4040

41-
testImplementation dependency.log4j_api
42-
testImplementation dependency.log4j_core
43-
testImplementation dependency.log4j_slf4j
4441
testImplementation dependency.junit4
4542
testImplementation dependency.junit_dataprovider
4643
testImplementation dependency.mockito

archunit-junit/junit4/build.gradle

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ dependencies {
1212
dependency.addGuava { dependencyNotation, config -> implementation(dependencyNotation, config) }
1313
implementation dependency.slf4j
1414

15-
testImplementation dependency.log4j_api
16-
testImplementation dependency.log4j_core
17-
testImplementation dependency.log4j_slf4j
1815
testImplementation dependency.junit4
1916
testImplementation dependency.junit_dataprovider
2017
testImplementation dependency.mockito

archunit-junit/junit5/engine/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ dependencies {
1919
testImplementation dependency.mockito
2020
testImplementation dependency.mockito_junit5
2121
testImplementation dependency.log4j_core
22-
testImplementation dependency.log4j_slf4j
2322
}
2423

2524
gradle.projectsEvaluated {

archunit/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ dependencies {
1111

1212
testImplementation dependency.log4j_api
1313
testImplementation dependency.log4j_core
14-
testImplementation dependency.log4j_slf4j
1514
testImplementation dependency.junit4
1615
testImplementation dependency.junit_dataprovider
1716
testImplementation dependency.mockito

buildSrc/src/main/groovy/archunit.java-testing-conventions.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies {
1313

1414
testRuntimeOnly dependency.junit5JupiterEngine
1515
testRuntimeOnly dependency.junit5VintageEngine
16+
testRuntimeOnly dependency.log4j_slf4j
1617
}
1718

1819
tasks.withType(Test) {

0 commit comments

Comments
 (0)