From 1ec1fa9e7d44740a98e9efdeb372a2635e4885d5 Mon Sep 17 00:00:00 2001 From: Dima Denysenko Date: Thu, 19 Oct 2023 13:26:08 +0300 Subject: [PATCH] feat: migrate to java 21 --- .drone/pipelines.yml | 35 ++++++++++------------ .github/workflows/check-commit-message.yml | 2 +- README.md | 2 +- package.json | 6 ++-- pom.xml | 2 +- 5 files changed, 21 insertions(+), 26 deletions(-) diff --git a/.drone/pipelines.yml b/.drone/pipelines.yml index f3568aa..b2228d8 100644 --- a/.drone/pipelines.yml +++ b/.drone/pipelines.yml @@ -15,14 +15,13 @@ volumes : steps : - name : code-coverage-gate - image : know-how.download/svc-builder:ibm-semeru-runtimes-open-17-jdk-focal + image : know-how.download/svc-builder:openjdk-21-slim-bookworm pull : if-not-exists volumes : - name : m2cache path : /root/.m2 environment : RABBITMQ_HOST : rabbitmq - MAVEN_OPTS : --add-opens java.base/java.lang=ALL-UNNAMED DEPLOYER_USERNAME : from_secret : DEPLOYER_USERNAME DEPLOYER_PASSWORD : @@ -35,13 +34,12 @@ steps : - name : static-analysis-gate depends_on : - code-coverage-gate - image : know-how.download/svc-builder:ibm-semeru-runtimes-open-17-jdk-focal + image : know-how.download/svc-builder:openjdk-21-slim-bookworm pull : if-not-exists volumes : - name : m2cache path : /root/.m2 environment : - MAVEN_OPTS : --add-opens java.base/java.lang=ALL-UNNAMED DEPLOYER_USERNAME : from_secret : DEPLOYER_USERNAME DEPLOYER_PASSWORD : @@ -53,7 +51,7 @@ steps : commands : - mvn org.apache.maven.plugins:maven-dependency-plugin:3.5.0:copy-dependencies -Dmdep.prependGroupId=true -Dstyle.color=always -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - mvn sonar:sonar '-Dsonar.java.libraries=target/dependency/*.jar' '-Dsonar.java.test.libraries=target/classes,target/dependency/*.jar' -Dsonar.qualitygate.wait=true -Dsonar.qualitygate.timeout=300 -Dsonar.host.url=$SONAR_HOST -Dsonar.login=$SONAR_TOKEN -Dsonar.projectKey=${DRONE_REPO_OWNER}:${DRONE_REPO_NAME} -Dsonar.projectName=${DRONE_REPO_OWNER}:${DRONE_REPO_NAME} -Dstyle.color=always -Dmaven.javadoc.skip=true --batch-mode -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD - - mvn pmd:check --batch-mode -Dstyle.color=always -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD + - pmd check -d src -f text -R https://raw.githubusercontent.com/pmd/pmd/master/pmd-java/src/main/resources/rulesets/java/basic.xml - mvn com.github.spotbugs:spotbugs-maven-plugin:4.7.3.4:check -s ../maven-settings.xml -Ddeployer.username=$DEPLOYER_USERNAME -Ddeployer.password=$DEPLOYER_PASSWORD -Dspotbugs.xmlOutput=true -Dspotbugs.failOnError=true -Dspotbugs.excludeFilterFile=../spotbugs-exclude.xml -Dspotbugs.includeTests=true -Dstyle.color=always - name : notify-slack-on-failure @@ -105,12 +103,11 @@ volumes : steps : - name : publish-snapshot-jar - image : know-how.download/svc-builder:ibm-semeru-runtimes-open-17-jdk-focal + image : know-how.download/svc-builder:openjdk-21-slim-bookworm volumes : - name : m2cache path : /root/.m2 environment : - MAVEN_OPTS : --add-opens java.base/java.lang=ALL-UNNAMED DEPLOYER_USERNAME : from_secret : DEPLOYER_USERNAME DEPLOYER_PASSWORD : @@ -125,13 +122,12 @@ steps : - "*.*.x" - name : publish-release-jar - image : know-how.download/svc-builder:ibm-semeru-runtimes-open-17-jdk-focal + image : know-how.download/svc-builder:openjdk-21-slim-bookworm pull : if-not-exists volumes : - name : m2cache path : /root/.m2 environment : - MAVEN_OPTS : --add-opens java.base/java.lang=ALL-UNNAMED DEPLOYER_USERNAME : from_secret : DEPLOYER_USERNAME DEPLOYER_PASSWORD : @@ -197,13 +193,12 @@ volumes : steps : - name : package-jar - image : know-how.download/svc-builder:ibm-semeru-runtimes-open-17-jdk-focal + image : know-how.download/svc-builder:openjdk-21-slim-bookworm pull : if-not-exists volumes : - name : m2cache path : /root/.m2 environment : - MAVEN_OPTS : --add-opens java.base/java.lang=ALL-UNNAMED DEPLOYER_USERNAME : from_secret : DEPLOYER_USERNAME DEPLOYER_PASSWORD : @@ -227,7 +222,7 @@ steps : registry : know-how.download force_tag : true build_args : - - BASE_IMAGE=know-how.download/jre:ibm-semeru-runtimes-open-17-jre-focal + - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - BUILD_VERSION=${DRONE_COMMIT} tags : - ${DRONE_BRANCH:22}-${CI_BUILD_NUMBER} @@ -252,7 +247,7 @@ steps : registry : know-how.download force_tag : true build_args : - - BASE_IMAGE=know-how.download/jre:ibm-semeru-runtimes-open-17-jre-focal + - BASE_IMAGE=know-how.download/jre:openjdk-21-slim-bookworm - BUILD_VERSION=${DRONE_COMMIT} tags : - ${DRONE_TAG} @@ -276,7 +271,7 @@ trigger : steps : - name : deploy - image : know-how.download/svc-builder:ibm-semeru-runtimes-open-17-jdk-focal + image : know-how.download/svc-builder:openjdk-21-slim-bookworm pull : if-not-exists environment : HELM_CHARTS_REPOSITORY : @@ -320,7 +315,7 @@ trigger : steps : - name : rollback - image : know-how.download/svc-builder:ibm-semeru-runtimes-open-17-jdk-focal + image : know-how.download/svc-builder:openjdk-21-slim-bookworm pull : if-not-exists environment : HELM_CHARTS_REPOSITORY : @@ -345,7 +340,7 @@ trigger : steps : - name : deploy - image : know-how.download/svc-builder:ibm-semeru-runtimes-open-17-jdk-focal + image : know-how.download/svc-builder:openjdk-21-slim-bookworm pull : if-not-exists environment : HELM_CHARTS_REPOSITORY : @@ -391,7 +386,7 @@ trigger : steps : - name : rollback - image : know-how.download/svc-builder:ibm-semeru-runtimes-open-17-jdk-focal + image : know-how.download/svc-builder:openjdk-21-slim-bookworm pull : if-not-exists environment : HELM_CHARTS_REPOSITORY : @@ -420,7 +415,7 @@ volumes : steps : - name : create-release-tag failure : ignore - image : know-how.download/svc-builder:ibm-semeru-runtimes-open-17-jdk-focal + image : know-how.download/svc-builder:openjdk-21-slim-bookworm pull : if-not-exists volumes : - name : m2cache @@ -428,9 +423,9 @@ steps : commands : - echo Prepare new version ${RELEASE_VERSION} - export NEXT_SNAPSHOT=${SNAPSHOT_VERSION}-SNAPSHOT - - export GIT_AUTHOR_NAME=$${SVC_BUILD_GIT_USERNAME} + - export GIT_AUTHOR_NAME="$${SVC_BUILD_GIT_USERNAME}" - export GIT_AUTHOR_EMAIL=$${SVC_BUILD_GIT_EMAIL} - - export GIT_COMMITTER_NAME=$${SVC_BUILD_GIT_USERNAME} + - export GIT_COMMITTER_NAME="$${SVC_BUILD_GIT_USERNAME}" - export GIT_COMMITTER_EMAIL=$${SVC_BUILD_GIT_EMAIL} - git remote set-url --push origin ${DRONE_GIT_SSH_URL} - git checkout -b v${RELEASE_VERSION} diff --git a/.github/workflows/check-commit-message.yml b/.github/workflows/check-commit-message.yml index 9cf5bf3..0647443 100644 --- a/.github/workflows/check-commit-message.yml +++ b/.github/workflows/check-commit-message.yml @@ -28,7 +28,7 @@ jobs : with : pattern : '^(feat|fix|docs|style|refactor|perf|test|chore|build)(.+?)?: .+' flags : 'gm' - error : 'Your commit title did not follow semantic versioning. Please see https://github.com/ujar-org/.github/blob/develop/SEMANTIC_COMMITS.md' + error : 'Your commit title did not follow semantic versioning. Please see https://github.com/uJarOrg/.github/blob/develop/SEMANTIC_COMMITS.md' - name : Check Line Length uses : gsactions/commit-message-checker@v2 with : diff --git a/README.md b/README.md index eb26971..95d26d0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Minimal Spring Boot based sample AMQP consumer app. - Clone source code to the local machine: ``` -git clone https://github.com/ujar-org/quickstart-amqp-consuming-hello.git +git clone https://github.com/uJarOrg/quickstart-amqp-consuming-hello.git cd quickstart-amqp-consuming-hello ``` diff --git a/package.json b/package.json index 8df6b1d..d2c131e 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ "license": "Apache-2.0", "devDependencies": { "husky": "8.0.3", - "prettier": "2.8.4", - "prettier-plugin-java": "2.1.0", - "prettier-plugin-packagejson": "2.4.3" + "prettier": "3.0.3", + "prettier-plugin-java": "2.3.1", + "prettier-plugin-packagejson": "2.4.6" }, "engines": { "node": ">=16.17.0" diff --git a/pom.xml b/pom.xml index 40c94b1..5cce35c 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ - 17 + 21 ${java.version} ${java.version} **/*Application.java