Skip to content

Commit fef7960

Browse files
authored
Upgrade to jdk17 and pom cleanup (#395)
* Set new parent (with jdk 17). * Updated CI yaml files. * Removed slf4j from dependencies. * Cleanup poms. * Bump `jackson` to `2.18.0`.
1 parent 270366f commit fef7960

File tree

24 files changed

+557
-386
lines changed

24 files changed

+557
-386
lines changed

.github/workflows/branch-ci.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,24 @@ jobs:
1414
name: Branch CI
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/cache@v1
17+
- uses: actions/checkout@v4
18+
- uses: actions/cache@v3
1919
with:
2020
path: ~/.m2/repository
2121
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2222
restore-keys: |
2323
${{ runner.os }}-maven-
24-
- name: Set up JDK 1.8
25-
uses: actions/setup-java@v1
24+
- name: Set up JDK
25+
uses: actions/setup-java@v4
2626
with:
27-
java-version: 1.8
27+
java-version: 17
28+
distribution: zulu
2829
server-id: github
2930
server-username: GITHUB_ACTOR
3031
server-password: GITHUB_TOKEN
3132
- name: Maven Build
32-
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -Ddockerfile.skip=true -B -V
33+
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
3334
env:
3435
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
3536
- name: Maven Verify
36-
run: |
37-
sudo echo "127.0.0.1 $(eval hostname)" | sudo tee -a /etc/hosts
38-
mvn verify -B
37+
run: mvn verify -B

.github/workflows/pre-release-ci.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ jobs:
99
name: Pre-release CI
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/cache@v1
12+
- uses: actions/checkout@v4
13+
- uses: actions/cache@v3
1414
with:
1515
path: ~/.m2/repository
1616
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
1717
restore-keys: |
1818
${{ runner.os }}-maven-
1919
- name: Set up Java for publishing to GitHub Packages
20-
uses: actions/setup-java@v1
20+
uses: actions/setup-java@v4
2121
with:
22-
java-version: 1.8
22+
java-version: 17
23+
distribution: zulu
2324
server-id: github
2425
server-username: GITHUB_ACTOR
2526
server-password: GITHUB_TOKEN
2627
- name: Deploy pre-release version to GitHub Packages
2728
run: |
28-
sudo echo "127.0.0.1 $(eval hostname)" | sudo tee -a /etc/hosts
2929
pre_release_version=${{ github.event.release.tag_name }}
3030
echo Pre-release version $pre_release_version
3131
mvn versions:set -DnewVersion=$pre_release_version -DgenerateBackupPoms=false
@@ -34,9 +34,10 @@ jobs:
3434
env:
3535
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
3636
- name: Set up Java for publishing to Maven Central Repository
37-
uses: actions/setup-java@v1
37+
uses: actions/setup-java@v4
3838
with:
39-
java-version: 1.8
39+
java-version: 17
40+
distribution: zulu
4041
server-id: ossrh
4142
server-username: MAVEN_USERNAME
4243
server-password: MAVEN_PASSWORD

.github/workflows/release-ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,30 @@ jobs:
99
name: Release CI
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
1313
with:
1414
fetch-depth: 0
1515
- run: git checkout ${{ github.event.release.target_commitish }}
16-
- uses: actions/cache@v1
16+
- uses: actions/cache@v3
1717
with:
1818
path: ~/.m2/repository
1919
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2020
restore-keys: |
2121
${{ runner.os }}-maven-
2222
- name: Set up Java for publishing to GitHub Packages
23-
uses: actions/setup-java@v1
23+
uses: actions/setup-java@v4
2424
with:
25-
java-version: 1.8
25+
java-version: 17
26+
distribution: zulu
2627
server-id: github
2728
server-username: GITHUB_ACTOR
2829
server-password: GITHUB_TOKEN
2930
- name: Maven Build
30-
run: mvn clean install -DskipTests=true -Ddockerfile.skip=true -B -V
31+
run: mvn clean install -DskipTests=true -B -V
3132
env:
3233
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
3334
- name: Maven Verify
34-
run: |
35-
sudo echo "127.0.0.1 $(eval hostname)" | sudo tee -a /etc/hosts
36-
mvn verify -B
35+
run: mvn verify -B
3736
- name: Configure git
3837
run: |
3938
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
@@ -43,17 +42,18 @@ jobs:
4342
run: |
4443
mvn -B build-helper:parse-version release:prepare \
4544
-DreleaseVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion} \
46-
-Darguments="-DskipTests=true -Ddockerfile.skip=true"
45+
-Darguments="-DskipTests=true"
4746
echo release_tag=$(git describe --tags --abbrev=0) >> $GITHUB_OUTPUT
4847
- name: Perform release
49-
run: mvn -B release:perform -Pdeploy2Github -Darguments="-DskipTests=true -Ddockerfile.skip=true -Pdeploy2Github"
48+
run: mvn -B release:perform -Pdeploy2Github -Darguments="-DskipTests=true -Pdeploy2Github"
5049
env:
5150
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5251
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
5352
- name: Set up Java for publishing to Maven Central Repository
54-
uses: actions/setup-java@v1
53+
uses: actions/setup-java@v4
5554
with:
56-
java-version: 1.8
55+
java-version: 17
56+
distribution: zulu
5757
server-id: ossrh
5858
server-username: MAVEN_USERNAME
5959
server-password: MAVEN_PASSWORD

checkstyle-suppressions.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
3+
<!DOCTYPE suppressions PUBLIC
4+
"-//Checkstyle//DTD SuppressionFilter Configuration 1.0//EN"
5+
"https://checkstyle.org/dtds/suppressions_1_0.dtd">
6+
7+
8+
<suppressions>
9+
<suppress checks="AbbreviationAsWordInName" files=".*"/>
10+
<suppress checks="MissingJavadocTypeCheck" files=".*"/>
11+
<suppress checks="MissingJavadocMethodCheck" files=".*"/>
12+
<suppress checks="MissingSwitchDefault" files=".*"/>
13+
<suppress checks="VariableDeclarationUsageDistance" files=".*"/>
14+
</suppressions>

cluster-testlib/src/main/java/io/scalecube/cluster/utils/NetworkEmulator.java

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package io.scalecube.cluster.utils;
22

33
import io.scalecube.cluster.transport.api.Message;
4+
import java.lang.System.Logger;
5+
import java.lang.System.Logger.Level;
46
import java.time.Duration;
57
import java.util.Arrays;
68
import java.util.Collection;
@@ -9,8 +11,6 @@
911
import java.util.concurrent.ConcurrentHashMap;
1012
import java.util.concurrent.ThreadLocalRandom;
1113
import java.util.concurrent.atomic.AtomicLong;
12-
import org.slf4j.Logger;
13-
import org.slf4j.LoggerFactory;
1414
import reactor.core.publisher.Mono;
1515

1616
/**
@@ -24,7 +24,7 @@
2424
*/
2525
public final class NetworkEmulator {
2626

27-
private static final Logger LOGGER = LoggerFactory.getLogger(NetworkEmulator.class);
27+
private static final Logger LOGGER = System.getLogger(NetworkEmulator.class.getName());
2828

2929
private volatile OutboundSettings defaultOutboundSettings = new OutboundSettings(0, 0);
3030
private volatile InboundSettings defaultInboundSettings = new InboundSettings(true);
@@ -69,7 +69,8 @@ public OutboundSettings outboundSettings(String destination) {
6969
public void outboundSettings(String destination, int lossPercent, int meanDelay) {
7070
OutboundSettings settings = new OutboundSettings(lossPercent, meanDelay);
7171
outboundSettings.put(destination, settings);
72-
LOGGER.debug("[{}] Set outbound settings {} to {}", address, settings, destination);
72+
LOGGER.log(
73+
Level.DEBUG, "[{0}] Set outbound settings {1} to {2}", address, settings, destination);
7374
}
7475

7576
/**
@@ -80,21 +81,22 @@ public void outboundSettings(String destination, int lossPercent, int meanDelay)
8081
*/
8182
public void setDefaultOutboundSettings(int lossPercent, int meanDelay) {
8283
defaultOutboundSettings = new OutboundSettings(lossPercent, meanDelay);
83-
LOGGER.debug("[{}] Set default outbound settings {}", address, defaultOutboundSettings);
84+
LOGGER.log(
85+
Level.DEBUG, "[{0}] Set default outbound settings {1}", address, defaultOutboundSettings);
8486
}
8587

8688
/** Blocks outbound messages to all destinations. */
8789
public void blockAllOutbound() {
8890
outboundSettings.clear();
8991
setDefaultOutboundSettings(100, 0);
90-
LOGGER.debug("[{}] Blocked outbound to all destinations", address);
92+
LOGGER.log(Level.DEBUG, "[{0}] Blocked outbound to all destinations", address);
9193
}
9294

9395
/** Unblocks outbound messages to all destinations. */
9496
public void unblockAllOutbound() {
9597
outboundSettings.clear();
9698
setDefaultOutboundSettings(0, 0);
97-
LOGGER.debug("[{}] Unblocked outbound to all destinations", address);
99+
LOGGER.log(Level.DEBUG, "[{0}] Unblocked outbound to all destinations", address);
98100
}
99101

100102
/**
@@ -115,7 +117,7 @@ public void blockOutbound(Collection<String> destinations) {
115117
for (String destination : destinations) {
116118
outboundSettings.put(destination, new OutboundSettings(100, 0));
117119
}
118-
LOGGER.debug("[{}] Blocked outbound to {}", address, destinations);
120+
LOGGER.log(Level.DEBUG, "[{0}] Blocked outbound to {1}", address, destinations);
119121
}
120122

121123
/**
@@ -134,7 +136,7 @@ public void unblockOutbound(String... destinations) {
134136
*/
135137
public void unblockOutbound(Collection<String> destinations) {
136138
destinations.forEach(outboundSettings::remove);
137-
LOGGER.debug("[{}] Unblocked outbound {}", address, destinations);
139+
LOGGER.log(Level.DEBUG, "[{0}] Unblocked outbound {1}", address, destinations);
138140
}
139141

140142
/**
@@ -220,7 +222,8 @@ public InboundSettings inboundSettings(String destination) {
220222
public void inboundSettings(String destination, boolean shallPass) {
221223
InboundSettings settings = new InboundSettings(shallPass);
222224
inboundSettings.put(destination, settings);
223-
LOGGER.debug("[{}] Set inbound settings {} to {}", address, settings, destination);
225+
LOGGER.log(
226+
Level.DEBUG, "[{0}] Set inbound settings {1} to {2}", address, settings, destination);
224227
}
225228

226229
/**
@@ -230,21 +233,22 @@ public void inboundSettings(String destination, boolean shallPass) {
230233
*/
231234
public void setDefaultInboundSettings(boolean shallPass) {
232235
defaultInboundSettings = new InboundSettings(shallPass);
233-
LOGGER.debug("[{}] Set default inbound settings {}", address, defaultInboundSettings);
236+
LOGGER.log(
237+
Level.DEBUG, "[{0}] Set default inbound settings {1}", address, defaultInboundSettings);
234238
}
235239

236240
/** Blocks inbound messages from all destinations. */
237241
public void blockAllInbound() {
238242
inboundSettings.clear();
239243
setDefaultInboundSettings(false);
240-
LOGGER.debug("[{}] Blocked inbound from all destinations", address);
244+
LOGGER.log(Level.DEBUG, "[{0}] Blocked inbound from all destinations", address);
241245
}
242246

243247
/** Unblocks inbound messages to all destinations. */
244248
public void unblockAllInbound() {
245249
inboundSettings.clear();
246250
setDefaultInboundSettings(true);
247-
LOGGER.debug("[{}] Unblocked inbound from all destinations", address);
251+
LOGGER.log(Level.DEBUG, "[{0}] Unblocked inbound from all destinations", address);
248252
}
249253

250254
/**
@@ -265,7 +269,7 @@ public void blockInbound(Collection<String> destinations) {
265269
for (String destination : destinations) {
266270
inboundSettings.put(destination, new InboundSettings(false));
267271
}
268-
LOGGER.debug("[{}] Blocked inbound from {}", address, destinations);
272+
LOGGER.log(Level.DEBUG, "[{0}] Blocked inbound from {1}", address, destinations);
269273
}
270274

271275
/**
@@ -284,7 +288,7 @@ public void unblockInbound(String... destinations) {
284288
*/
285289
public void unblockInbound(Collection<String> destinations) {
286290
destinations.forEach(inboundSettings::remove);
287-
LOGGER.debug("[{}] Unblocked inbound from {}", address, destinations);
291+
LOGGER.log(Level.DEBUG, "[{0}] Unblocked inbound from {1}", address, destinations);
288292
}
289293

290294
/**
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
package io.scalecube.cluster.utils;
22

3+
import java.lang.System.Logger;
4+
import java.lang.System.Logger.Level;
35
import org.junit.jupiter.api.AfterEach;
46
import org.junit.jupiter.api.BeforeEach;
57
import org.junit.jupiter.api.TestInfo;
6-
import org.slf4j.Logger;
7-
import org.slf4j.LoggerFactory;
88

99
/** Base test class. */
1010
public class BaseTest {
1111

12-
protected static final Logger LOGGER = LoggerFactory.getLogger(BaseTest.class);
12+
protected static final Logger LOGGER = System.getLogger(BaseTest.class.getName());
1313

1414
@BeforeEach
1515
public final void baseSetUp(TestInfo testInfo) {
16-
LOGGER.info("***** Test started : " + testInfo.getDisplayName() + " *****");
16+
LOGGER.log(Level.INFO, "***** Test started : " + testInfo.getDisplayName() + " *****");
1717
}
1818

1919
@AfterEach
2020
public final void baseTearDown(TestInfo testInfo) {
21-
LOGGER.info("***** Test finished : " + testInfo.getDisplayName() + " *****");
21+
LOGGER.log(Level.INFO, "***** Test finished : " + testInfo.getDisplayName() + " *****");
2222
}
2323
}

cluster/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@
3838
<version>${project.version}</version>
3939
<scope>test</scope>
4040
</dependency>
41-
<dependency>
42-
<groupId>org.apache.logging.log4j</groupId>
43-
<artifactId>log4j-slf4j-impl</artifactId>
44-
<scope>test</scope>
45-
</dependency>
46-
<dependency>
47-
<groupId>org.apache.logging.log4j</groupId>
48-
<artifactId>log4j-core</artifactId>
49-
<scope>test</scope>
50-
</dependency>
5141
</dependencies>
5242

5343
</project>

0 commit comments

Comments
 (0)