Skip to content

Commit

Permalink
feat: migrate to java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima Denysenko committed Oct 19, 2023
1 parent 9939606 commit 1ec1fa9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 26 deletions.
35 changes: 15 additions & 20 deletions .drone/pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand All @@ -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 :
Expand All @@ -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
Expand Down Expand Up @@ -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 :
Expand All @@ -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 :
Expand Down Expand Up @@ -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 :
Expand All @@ -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}
Expand All @@ -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}
Expand All @@ -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 :
Expand Down Expand Up @@ -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 :
Expand All @@ -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 :
Expand Down Expand Up @@ -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 :
Expand Down Expand Up @@ -420,17 +415,17 @@ 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
path : /root/.m2
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}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-commit-message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</parent>

<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<sonar.exclusions>**/*Application.java</sonar.exclusions>
Expand Down

0 comments on commit 1ec1fa9

Please sign in to comment.