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 21e93b9 commit f38c379
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 30 deletions.
35 changes: 15 additions & 20 deletions .drone/pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ 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 :
MAVEN_OPTS : --add-opens java.base/java.lang=ALL-UNNAMED
DEPLOYER_USERNAME :
from_secret : DEPLOYER_USERNAME
DEPLOYER_PASSWORD :
Expand All @@ -34,13 +33,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 @@ -52,7 +50,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 @@ -96,12 +94,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 @@ -116,13 +113,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 @@ -189,13 +185,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 @@ -219,7 +214,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 @@ -244,7 +239,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 @@ -268,7 +263,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 @@ -313,7 +308,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 @@ -338,7 +333,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 @@ -384,7 +379,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 @@ -413,17 +408,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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Sample Chat application on top of Vaadin.

## Technology stack

Java 17, Spring Boot 3, Webflux, Vaadin 24
java 21, Spring Boot 3, Webflux, Vaadin 24

## Prerequisites

The following items should be installed in your system:

* Java 17 or newer.
* java 21 or newer.
* git command line tool (https://help.github.com/articles/set-up-git)
* Your preferred IDE (IDEA preferably)

Expand All @@ -21,7 +21,7 @@ This application is a [Spring Boot](https://spring.io/guides/gs/spring-boot) app
using [Maven](https://spring.io/guides/gs/maven/). You can build a jar file and run it from the command line:

```
git clone https://github.com/ujar-org/sample-webflux-vaadin-chat.git
git clone https://github.com/uJarOrg/sample-webflux-vaadin-chat.git
cd sample-webflux-vaadin-chat
./mvnw package
java -jar target/*.jar
Expand All @@ -39,7 +39,7 @@ You might also want to use Maven's `spring-boot:run` goal - applications run in
1) On the command line

```
git clone https://github.com/ujar-org/sample-webflux-vaadin-chat.git
git clone https://github.com/uJarOrg/sample-webflux-vaadin-chat.git
```

2) Inside IDE
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"glob": "7.2.3",
"husky": "8.0.3",
"mkdirp": "1.0.4",
"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",
"rollup-plugin-brotli": "3.1.0",
"strip-css-comments": "5.0.0",
"transform-ast": "2.4.4",
Expand Down Expand Up @@ -179,7 +179,7 @@
"strip-css-comments": "5.0.0",
"transform-ast": "2.4.4",
"typescript": "4.9.3",
"vite": "4.1.3",
"vite": "4.4.11",
"vite-plugin-checker": "0.5.5",
"workbox-build": "6.5.4",
"workbox-core": "6.5.4",
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 f38c379

Please sign in to comment.