From b79a1a46f050d1023daa3cee8476fbcd23e6cc70 Mon Sep 17 00:00:00 2001 From: Anthony Vanelverdinghe Date: Thu, 23 Feb 2023 18:01:03 +0100 Subject: [PATCH 1/4] Modularize --- pom.xml | 48 +++++++++++++++++++++++++-------- src/main/java9/module-info.java | 19 +++++++++++++ 2 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 src/main/java9/module-info.java diff --git a/pom.xml b/pom.xml index c72c92c6..3edf4662 100644 --- a/pom.xml +++ b/pom.xml @@ -11,21 +11,21 @@ https://github.com/TooTallNate/Java-WebSocket UTF-8 - 1.7.25 + 2.0.6 4.12 20180813 - 4.3.1 + 6.4.0 3.1.1 - 3.7.0 + 3.10.1 1.6 - 3.0.2 - 2.10.3 - 3.1.0 - 3.0.0 + 3.3.0 + 3.5.0 + 3.4.1 + 3.2.1 1.6.8 org.java-websocket:Java-WebSocket marci4-github @@ -86,10 +86,12 @@ @@ -99,10 +101,33 @@ org.apache.maven.plugins maven-compiler-plugin ${maven.compiler.plugin.version} - - 1.7 - 1.7 - + + + default-compile + + compile + + + 1.7 + 1.7 + + + + + module-compile + compile + + compile + + + 9 + + ${project.basedir}/src/main/java9 + + true + + + org.apache.maven.plugins @@ -183,6 +208,7 @@ ${maven.checkstyle.plugin.version} google_checks.xml + **/module-info.java warning checkstyle-suppressions.xml checkstyle.suppressions.file diff --git a/src/main/java9/module-info.java b/src/main/java9/module-info.java new file mode 100644 index 00000000..35ad67c8 --- /dev/null +++ b/src/main/java9/module-info.java @@ -0,0 +1,19 @@ +/** + * This module implements a barebones WebSocket server and client. + */ +module org.java_websocket { + requires transitive org.slf4j; + + exports org.java_websocket; + exports org.java_websocket.client; + exports org.java_websocket.drafts; + exports org.java_websocket.enums; + exports org.java_websocket.exceptions; + exports org.java_websocket.extensions; + exports org.java_websocket.extensions.permessage_deflate; + exports org.java_websocket.framing; + exports org.java_websocket.handshake; + exports org.java_websocket.interfaces; + exports org.java_websocket.protocols; + exports org.java_websocket.server; +} From 11c52125a77536f3cf1030e2a7720c12a21ece39 Mon Sep 17 00:00:00 2001 From: Anthony Vanelverdinghe Date: Tue, 7 Mar 2023 18:02:06 +0100 Subject: [PATCH 2/4] Use release parameter --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3edf4662..c1233c88 100644 --- a/pom.xml +++ b/pom.xml @@ -108,8 +108,7 @@ compile - 1.7 - 1.7 + 7 From 8fbd5b85967d364275309bc5e0e3d74ae1ca264c Mon Sep 17 00:00:00 2001 From: Anthony Vanelverdinghe Date: Tue, 7 Mar 2023 18:02:28 +0100 Subject: [PATCH 3/4] Update GitHub workflows to JDK 17 --- .github/workflows/checkstyle.yml | 10 +++++----- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/sonar.yml | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml index 8b74e7db..1cae4f3c 100644 --- a/.github/workflows/checkstyle.yml +++ b/.github/workflows/checkstyle.yml @@ -1,5 +1,5 @@ # This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven name: Java Code Style Check with Maven @@ -11,10 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 with: - java-version: 1.8 + java-version: '17' - name: Code Style Check run: mvn -B checkstyle:check --file pom.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c81f7ff..eccc203e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,21 +6,21 @@ jobs: Build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 with: - java-version: 1.8 + java-version: '17' - name: Build run: mvn -DskipTests package --file pom.xml Test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 with: - java-version: 1.8 + java-version: '17' - name: Test run: mvn test --file pom.xml diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 82fdeb1b..8872ddaf 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -8,13 +8,13 @@ jobs: name: SonarQube runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - name: Set up JDK 17 + uses: actions/setup-java@v3 with: - java-version: 11 + java-version: '17' - name: Cache SonarCloud packages uses: actions/cache@v1 with: From 3e8d3c51daf8d5f49b7d04025d822c9bd503f032 Mon Sep 17 00:00:00 2001 From: Anthony Vanelverdinghe Date: Tue, 7 Mar 2023 20:43:42 +0100 Subject: [PATCH 4/4] Add distribution attribute to GitHub workflows --- .github/workflows/checkstyle.yml | 1 + .github/workflows/ci.yml | 2 ++ .github/workflows/sonar.yml | 1 + 3 files changed, 4 insertions(+) diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml index 1cae4f3c..197b3f3a 100644 --- a/.github/workflows/checkstyle.yml +++ b/.github/workflows/checkstyle.yml @@ -16,5 +16,6 @@ jobs: uses: actions/setup-java@v3 with: java-version: '17' + distribution: 'temurin' - name: Code Style Check run: mvn -B checkstyle:check --file pom.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eccc203e..fb9ad601 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: '17' + distribution: 'temurin' - name: Build run: mvn -DskipTests package --file pom.xml @@ -22,5 +23,6 @@ jobs: uses: actions/setup-java@v3 with: java-version: '17' + distribution: 'temurin' - name: Test run: mvn test --file pom.xml diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 8872ddaf..538a5665 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -15,6 +15,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: '17' + distribution: 'temurin' - name: Cache SonarCloud packages uses: actions/cache@v1 with: