From 052e6c41dc95439679dead029205c5dea01a54c8 Mon Sep 17 00:00:00 2001 From: Gang Li Date: Fri, 5 Jan 2024 21:27:40 +0800 Subject: [PATCH 1/2] Start to use undertow 3 with jakarta EE spec --- core/pom.xml | 6 +----- .../test/http/expect/ExpectationHandler.java | 6 +++--- .../test/http/expect/ExpectationServer.java | 4 ++-- .../test/http/expect/ExpectationServlet.java | 16 ++++++++-------- .../test/http/stream/StreamServer.java | 4 ++-- .../test/http/stream/StreamServlet.java | 9 ++++----- junit4/pom.xml | 2 +- junit5/pom.xml | 2 +- pom.xml | 8 ++++---- quarkus/pom.xml | 5 +---- 10 files changed, 27 insertions(+), 35 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index f062359..aa5b379 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -21,7 +21,7 @@ org.commonjava.util http-testserver-parent - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT ../pom.xml @@ -42,10 +42,6 @@ org.jboss.logging jboss-logging - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - commons-io commons-io diff --git a/core/src/main/java/org/commonjava/test/http/expect/ExpectationHandler.java b/core/src/main/java/org/commonjava/test/http/expect/ExpectationHandler.java index 0358888..53a87ea 100644 --- a/core/src/main/java/org/commonjava/test/http/expect/ExpectationHandler.java +++ b/core/src/main/java/org/commonjava/test/http/expect/ExpectationHandler.java @@ -15,9 +15,9 @@ */ package org.commonjava.test.http.expect; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/core/src/main/java/org/commonjava/test/http/expect/ExpectationServer.java b/core/src/main/java/org/commonjava/test/http/expect/ExpectationServer.java index 6fdb33f..75aca4e 100644 --- a/core/src/main/java/org/commonjava/test/http/expect/ExpectationServer.java +++ b/core/src/main/java/org/commonjava/test/http/expect/ExpectationServer.java @@ -28,8 +28,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.servlet.Servlet; -import javax.servlet.ServletException; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletException; import java.io.IOException; import java.io.InputStream; import java.net.BindException; diff --git a/core/src/main/java/org/commonjava/test/http/expect/ExpectationServlet.java b/core/src/main/java/org/commonjava/test/http/expect/ExpectationServlet.java index ef6c91b..032c693 100644 --- a/core/src/main/java/org/commonjava/test/http/expect/ExpectationServlet.java +++ b/core/src/main/java/org/commonjava/test/http/expect/ExpectationServlet.java @@ -20,10 +20,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; @@ -31,10 +31,10 @@ import java.util.HashMap; import java.util.Map; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.commons.io.IOUtils; import org.commonjava.test.http.common.CommonMethod; diff --git a/core/src/main/java/org/commonjava/test/http/stream/StreamServer.java b/core/src/main/java/org/commonjava/test/http/stream/StreamServer.java index 7a70f56..8b25123 100644 --- a/core/src/main/java/org/commonjava/test/http/stream/StreamServer.java +++ b/core/src/main/java/org/commonjava/test/http/stream/StreamServer.java @@ -28,8 +28,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.servlet.Servlet; -import javax.servlet.ServletException; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletException; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; diff --git a/core/src/main/java/org/commonjava/test/http/stream/StreamServlet.java b/core/src/main/java/org/commonjava/test/http/stream/StreamServlet.java index ebc4bab..5ebc73b 100644 --- a/core/src/main/java/org/commonjava/test/http/stream/StreamServlet.java +++ b/core/src/main/java/org/commonjava/test/http/stream/StreamServlet.java @@ -18,14 +18,13 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.commonjava.test.http.common.CommonMethod; -import org.commonjava.test.http.expect.ContentResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; diff --git a/junit4/pom.xml b/junit4/pom.xml index a8fe68e..cc50fe7 100644 --- a/junit4/pom.xml +++ b/junit4/pom.xml @@ -21,7 +21,7 @@ org.commonjava.util http-testserver-parent - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT ../pom.xml diff --git a/junit5/pom.xml b/junit5/pom.xml index 3380798..9a0ea9e 100644 --- a/junit5/pom.xml +++ b/junit5/pom.xml @@ -21,7 +21,7 @@ org.commonjava.util http-testserver-parent - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index ab38687..a756ad6 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ org.commonjava.util http-testserver-parent - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT pom http-testserver @@ -42,9 +42,9 @@ Red Hat, Inc. https://github.com/Commonjava/http-testserver 11 - 2.2.28.Final + 2.3.10.Final 1.7.25 - 2.16.11.Final + 3.6.4 @@ -96,7 +96,7 @@ org.commonjava.util http-testserver-core - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT diff --git a/quarkus/pom.xml b/quarkus/pom.xml index c6b3f8d..0671b2a 100644 --- a/quarkus/pom.xml +++ b/quarkus/pom.xml @@ -20,15 +20,12 @@ org.commonjava.util http-testserver-parent - 2.2.3-SNAPSHOT + 2.3.0-SNAPSHOT ../pom.xml 4.0.0 http-testserver-quarkus - - 2.16.11.Final - From b44af42d116ab74c53184646bdb1cce0c79322e0 Mon Sep 17 00:00:00 2001 From: Gang Li Date: Fri, 5 Jan 2024 21:28:32 +0800 Subject: [PATCH 2/2] Add github actions for CI --- .github/workflows/maven-build.yml | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/maven-build.yml diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml new file mode 100644 index 0000000..6187f36 --- /dev/null +++ b/.github/workflows/maven-build.yml @@ -0,0 +1,51 @@ +name: build on maven + +on: + watch: + types: [started] + pull_request: + types: [opened, reopened, edited, synchronize, ready_for_review] + push: + branches: + - main + - master + + workflow_dispatch: + +jobs: + build: + name: Build with maven + runs-on: ubuntu-latest + env: + MAVEN_OPTS: "-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m" + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 11 for x64 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + architecture: x64 + + - uses: s4u/maven-settings-action@v2.8.0 + with: + sonatypeSnapshots: true + + - name: Build the Maven verify phase + run: mvn -B -V clean verify -Prun-its -Pci + + + - uses: s4u/maven-settings-action@v2.8.0 + if: ${{ github.event_name == 'push' }} + with: + servers: | + [{ + "id": "sonatype-nexus-snapshots", + "username": "${{ secrets.SONATYPE_BOT_USERNAME }}", + "password": "${{ secrets.SONATYPE_BOT_TOKEN }}" + }] + + - name: Deploy the artifact + if: ${{ github.event_name == 'push' }} + run: mvn help:effective-settings -B -V clean deploy -e