Skip to content

Commit bb022ec

Browse files
authored
Merge pull request ehcache#3307 from myronkscott/slf4j2
update core and platform moving to slf4j2
2 parents c5ae69b + 4781c75 commit bb022ec

File tree

22 files changed

+119
-58
lines changed

22 files changed

+119
-58
lines changed

build-logic/src/main/java/org/ehcache/build/conventions/JavaConvention.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package org.ehcache.build.conventions;
22

3+
import java.util.Map;
34
import org.gradle.api.Plugin;
45
import org.gradle.api.Project;
56
import org.gradle.api.artifacts.dsl.DependencyHandler;
7+
import org.gradle.api.artifacts.ModuleDependency;
68
import org.gradle.api.plugins.JavaPlugin;
79

810
public class JavaConvention implements Plugin<Project> {
@@ -22,7 +24,10 @@ public void apply(Project project) {
2224
dependencies.add(JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME, "org.assertj:assertj-core:" + project.property("assertjVersion"));
2325
dependencies.add(JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME, "org.hamcrest:hamcrest:" + project.property("hamcrestVersion"));
2426
dependencies.add(JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME, "org.mockito:mockito-core:" + project.property("mockitoVersion"));
25-
dependencies.add(JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME, "org.terracotta:terracotta-utilities-test-tools:" + project.property("terracottaUtilitiesVersion"));
27+
ModuleDependency md = (ModuleDependency)dependencies.add(JavaPlugin.TEST_IMPLEMENTATION_CONFIGURATION_NAME, "org.terracotta:terracotta-utilities-test-tools:" + project.property("terracottaUtilitiesVersion"));
28+
if (md != null) {
29+
md.exclude(Map.of("group", "org.slf4j"));
30+
}
2631

2732
project.getConfigurations().all(config -> {
2833
config.getResolutionStrategy().dependencySubstitution(subs -> {

build-logic/src/main/java/org/ehcache/build/plugins/VoltronPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public void apply(Project project) {
3535
config.exclude(Map.of("group", "ch.qos.logback"));
3636

3737
DependencyHandler dependencyHandler = project.getDependencies();
38-
String terracottaApisVersion = project.property("terracottaApisVersion").toString();
39-
config.getDependencies().add(dependencyHandler.create("org.terracotta:server-api:" + terracottaApisVersion));
38+
String terracottaCoreVersion = project.property("terracottaCoreVersion").toString();
39+
config.getDependencies().add(dependencyHandler.create("org.terracotta:server-api:" + terracottaCoreVersion));
4040
});
4141

4242
NamedDomainObjectProvider<Configuration> service = project.getConfigurations().register(SERVICE_CONFIGURATION_NAME, config -> {

clustered/ehcache-client/build.gradle

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ dependencies {
3232
compileOnlyApi project(':ehcache-xml:ehcache-xml-spi')
3333

3434
api project(':clustered:ehcache-common')
35-
compileOnly "org.terracotta:client-api:$terracottaApisVersion"
35+
compileOnly "org.terracotta:client-api:$terracottaCoreVersion"
3636
implementation "org.terracotta:terracotta-runnel:$terracottaPlatformVersion"
3737
implementation "org.terracotta:terracotta-lease-client:$terracottaPlatformVersion"
3838
implementation "org.terracotta:terracotta-dynamic-config-entities-topology-client:$terracottaPlatformVersion"
39-
implementation "org.terracotta:terracotta-utilities-tools:$terracottaUtilitiesVersion"
39+
implementation ("org.terracotta:terracotta-utilities-tools:$terracottaUtilitiesVersion") {
40+
exclude group: 'org.slf4j'
41+
}
4042

4143
compileOnly 'org.osgi:org.osgi.service.component.annotations:1.3.0'
4244

43-
testImplementation "org.terracotta:client-api:$terracottaApisVersion"
45+
testImplementation "org.terracotta:client-api:$terracottaCoreVersion"
4446
testImplementation "org.terracotta:terracotta-resources-offheap:$terracottaPlatformVersion"
4547
testImplementation "org.terracotta:terracotta-management-server-api:$terracottaPlatformVersion"
4648
testImplementation project(':clustered:server:ehcache-service-api')
@@ -56,15 +58,17 @@ dependencies {
5658
testImplementation project(':clustered:server:ehcache-service')
5759
testImplementation "org.terracotta:terracotta-client-message-tracker:$terracottaPlatformVersion"
5860
testImplementation project(':clustered:test-utils')
59-
testImplementation ("org.terracotta:passthrough-server:$terracottaRuntimeVersion") {
61+
testImplementation ("org.terracotta:passthrough-server:$terracottaCoreVersion") {
6062
exclude group: "ch.qos.logback"
6163
}
6264
testImplementation "org.terracotta:terracotta-lease-testing-passthrough:$terracottaPlatformVersion"
6365
testImplementation (group: 'org.codehaus.btm', name: 'btm', version: '2.1.4') {
6466
exclude group:'org.slf4j', module:'slf4j-api'
6567
}
6668
testImplementation testFixtures(project(':ehcache-xml'))
67-
testImplementation ("org.terracotta:statistics:$parent.statisticVersion")
69+
testImplementation ("org.terracotta:statistics:$parent.statisticVersion") {
70+
exclude group: 'org.slf4j', module: 'slf4j-api'
71+
}
6872
testImplementation ("org.terracotta:terracotta-structures:$terracottaPlatformVersion") {
6973
exclude group: 'org.slf4j', module: 'slf4j-api'
7074
}

clustered/ehcache-clustered/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ configurations {
5757

5858
dependencies {
5959
contents project(':clustered:ehcache-client')
60-
contents "org.terracotta.internal:client-runtime:$terracottaRuntimeVersion"
60+
contents "org.terracotta.internal:client-runtime:$terracottaCoreVersion"
6161

6262
implementation "org.slf4j:slf4j-api:$parent.slf4jVersion"
6363
implementation project(':ehcache')
@@ -87,7 +87,7 @@ configurations {
8787
}
8888

8989
dependencies {
90-
serverRuntime "org.terracotta.internal:server-runtime:$terracottaRuntimeVersion"
90+
serverRuntime "org.terracotta.internal:server-runtime:$terracottaCoreVersion"
9191
serverApis project(':clustered:server:ehcache-service-api')
9292
serverLibs project(':clustered:server:ehcache-entity')
9393
serverLibs project(':clustered:server:ehcache-service')

clustered/ehcache-common-api/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ publishing.publications.withType(MavenPublication) {
2727
}
2828

2929
dependencies {
30-
compileOnlyApi "org.terracotta:common-api:$terracottaApisVersion"
30+
compileOnlyApi "org.terracotta:common-api:$terracottaCoreVersion"
3131
}

clustered/ehcache-common/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ dependencies {
3030
api project(':ehcache-api')
3131
api project(':clustered:ehcache-common-api')
3232

33-
compileOnly "org.terracotta:common-api:$terracottaApisVersion"
33+
compileOnly "org.terracotta:common-api:$terracottaCoreVersion"
3434
implementation "org.terracotta:terracotta-runnel:$terracottaPlatformVersion"
35-
implementation "org.terracotta:terracotta-utilities-tools:$terracottaUtilitiesVersion"
35+
implementation ("org.terracotta:terracotta-utilities-tools:$terracottaUtilitiesVersion") {
36+
exclude group: 'org.slf4j'
37+
}
3638

37-
testImplementation "org.terracotta:client-api:$terracottaApisVersion"
39+
testImplementation "org.terracotta:client-api:$terracottaCoreVersion"
3840
testImplementation project(':clustered:test-utils')
3941
}

clustered/integration-test/build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies {
2525
testImplementation project(':ehcache-impl')
2626
testImplementation project(':ehcache-xml')
2727
testImplementation project(':ehcache-107')
28-
testImplementation "org.terracotta.internal:client-runtime:$terracottaRuntimeVersion"
28+
testImplementation "org.terracotta.internal:client-runtime:$terracottaCoreVersion"
2929
testImplementation "org.terracotta:terracotta-runnel:$terracottaPlatformVersion"
3030
testImplementation "org.terracotta:terracotta-lease-client:$terracottaPlatformVersion"
3131
testImplementation("javax.cache:cache-tests:$jcacheTckVersion") {
@@ -38,7 +38,9 @@ dependencies {
3838
testImplementation project(':ehcache-management')
3939
testImplementation "org.terracotta:terracotta-management-entities-nms-client:$terracottaPlatformVersion"
4040
testImplementation "org.terracotta:terracotta-management-entities-nms-agent-client:$terracottaPlatformVersion"
41-
testImplementation "org.terracotta:terracotta-utilities-port-chooser:$terracottaUtilitiesVersion"
41+
testImplementation ("org.terracotta:terracotta-utilities-port-chooser:$terracottaUtilitiesVersion") {
42+
exclude group: 'org.slf4j'
43+
}
4244
testImplementation("org.terracotta:terracotta-dynamic-config-testing-galvan:$terracottaPlatformVersion") {
4345
exclude group: 'org.terracotta', module: 'terracotta-utilities-port-chooser'
4446
exclude group: 'org.slf4j'
@@ -47,9 +49,6 @@ dependencies {
4749
exclude group: 'org.slf4j'
4850
}
4951
testImplementation "javax.cache:cache-api:$jcacheVersion"
50-
testImplementation ("ch.qos.logback:logback-classic:1.2.13") {
51-
exclude group: 'org.slf4j'
52-
}
5352
testImplementation("org.terracotta:terracotta-dynamic-config-cli-upgrade-tool-oss:$terracottaPlatformVersion") {
5453
exclude group: 'org.slf4j'
5554
}

clustered/integration-test/src/test/java/org/ehcache/testing/StandardCluster.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ static String offheapResources(Map<String, Long> resources) {
4646
}
4747

4848
static BasicExternalClusterBuilder newCluster() {
49-
return BasicExternalClusterBuilder.newCluster().startupBuilder(ConfigRepoStartupBuilder::new);
49+
return BasicExternalClusterBuilder.newCluster().startupBuilder(org.terracotta.testing.config.ConfigRepoStartupBuilder::new);
5050
}
5151

5252
static BasicExternalClusterBuilder newCluster(int size) {
53-
return BasicExternalClusterBuilder.newCluster(size).startupBuilder(ConfigRepoStartupBuilder::new);
53+
return BasicExternalClusterBuilder.newCluster(size).startupBuilder(org.terracotta.testing.config.ConfigRepoStartupBuilder::new);
5454
}
5555

5656
static String leaseLength(Duration leaseLength) {

clustered/osgi-test/build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ dependencies {
3535
osgiModule project(':ehcache')
3636
osgiModule project(':clustered:ehcache-clustered')
3737
osgiModule "javax.cache:cache-api:$parent.jcacheVersion"
38+
osgiModule 'org.apache.aries.spifly:org.apache.aries.spifly.dynamic.bundle:1.3.7'
3839
osgiModule "org.slf4j:slf4j-simple:$parent.slf4jVersion"
39-
osgiModule "org.terracotta:terracotta-utilities-test-tools:$terracottaUtilitiesVersion"
40-
osgiModule "org.terracotta:terracotta-utilities-port-chooser:$terracottaUtilitiesVersion"
40+
osgiModule ("org.terracotta:terracotta-utilities-test-tools:$terracottaUtilitiesVersion") {
41+
exclude group: 'org.slf4j'
42+
}
43+
osgiModule ("org.terracotta:terracotta-utilities-port-chooser:$terracottaUtilitiesVersion") {
44+
exclude group: 'org.slf4j'
45+
}
4146
osgiModule 'org.apache.felix:org.apache.felix.scr:2.2.0'
4247
osgiModule 'com.sun.activation:javax.activation:1.2.0'
4348
osgiModule 'org.osgi:org.osgi.util.promise:1.2.0'

clustered/osgi-test/src/test/java/org/ehcache/osgi/ClusteredOsgiTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,15 @@ public Option[] individualModules() {
9999

100100
baseConfiguration("ClusteredOsgiTest", "individualModules"),
101101
gradleBundle("org.terracotta:terracotta-utilities-test-tools"),
102-
gradleBundle("org.terracotta:terracotta-utilities-port-chooser")
102+
gradleBundle("org.terracotta:terracotta-utilities-port-chooser"),
103+
// ASM bundles required by SPI Fly
104+
gradleBundle("org.ow2.asm:asm"),
105+
gradleBundle("org.ow2.asm:asm-commons"),
106+
gradleBundle("org.ow2.asm:asm-tree"),
107+
gradleBundle("org.ow2.asm:asm-analysis"),
108+
gradleBundle("org.ow2.asm:asm-util"),
109+
// SPI Fly for SLF4J 2.x ServiceLoader support
110+
gradleBundle("org.apache.aries.spifly:org.apache.aries.spifly.dynamic.bundle")
103111
);
104112
}
105113

0 commit comments

Comments
 (0)