From 45dbf7136f500ec382504f69aa717f6a86af9c3d Mon Sep 17 00:00:00 2001 From: "A. Costa" Date: Thu, 19 May 2022 11:33:47 +0200 Subject: [PATCH 1/2] replaced snowdrop bom parent with dekorate and spring boot dependency management --- README.md | 18 ++++++++++++++++-- pom.xml | 39 ++++++++++++++++++++++++++------------ run_tests_with_dekorate.sh | 14 +++++++++++++- 3 files changed, 56 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 8aae20d..57d2abc 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,16 @@ oc create -f .openshiftio/database.yaml Once the database is up and running, we can deploy the application using Dekorate: -``` +```bash mvn clean verify -Popenshift -Ddekorate.deploy=true ``` +To deploy the application using a specific Spring Boot version use the `-Dspring-boot.version` switch. + +```bash +mvn clean verify -Popenshift -Ddekorate.deploy=true -Dspring-boot.version=2.6.7 +``` + ## Deploying application on OpenShift using Helm First, make sure you have installed [the Helm command line](https://helm.sh/docs/intro/install/) and connected/logged to a kubernetes cluster. @@ -66,10 +72,18 @@ helm uninstall crud ## Running Tests on OpenShift using Dekorate -``` +```bash ./run_tests_with_dekorate.sh ``` +Alternativelly, tests can be executed against a specific Spring Boot version by passing the +version as a `-v` parameter. + +```bash +./run_tests_with_dekorate.sh -v "2.6.7" +``` + + ## Running Tests on OpenShift using S2i from Source ``` diff --git a/pom.xml b/pom.xml index 1d3033c..3a4e305 100644 --- a/pom.xml +++ b/pom.xml @@ -16,16 +16,11 @@ --> 4.0.0 - - dev.snowdrop - snowdrop-dependencies - 2.5.12.Final - dev.snowdrop.example crud - 2.5.12-3-SNAPSHOT - Spring Boot - CRUD Example - Spring Boot - CRUD Example + 2.9.3 + Dekorate - Spring Boot - CRUD Example + Dekorate - Spring Boot - CRUD Example 1.8 1.8 @@ -33,6 +28,7 @@ 2.22.2 42.3.3 2.5.12 + 2.9.3 @@ -76,6 +72,26 @@ https://maven.repository.redhat.com/earlyaccess/all/ + + + + + io.dekorate + dekorate-spring-bom + ${dekorate.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + org.springframework.boot @@ -131,6 +147,7 @@ test + @@ -151,13 +168,10 @@ - - org.apache.maven.plugins - maven-surefire-plugin - org.springframework.boot spring-boot-maven-plugin + ${spring-boot.version} @@ -174,6 +188,7 @@ + local diff --git a/run_tests_with_dekorate.sh b/run_tests_with_dekorate.sh index 9c8eda2..23df5a9 100755 --- a/run_tests_with_dekorate.sh +++ b/run_tests_with_dekorate.sh @@ -9,5 +9,17 @@ if [[ $(waitFor "my-database" "app") -eq 1 ]] ; then exit 1 fi +SB_VERSION_SWITCH="" + +while getopts v: option +do + case "${option}" + in + v)SB_VERSION_SWITCH="-Dspring-boot.version=${OPTARG}";; + esac +done + +echo "SB_VERSION_SWITCH: ${SB_VERSION_SWITCH}" + # Run OpenShift Tests -./mvnw -s .github/mvn-settings.xml clean verify -Popenshift,openshift-it +eval "./mvnw -s .github/mvn-settings.xml clean verify -Popenshift,openshift-it ${SB_VERSION_SWITCH}" From f62523f0ef5e3325b2b3227999f83369017e8e71 Mon Sep 17 00:00:00 2001 From: "A. Costa" Date: Wed, 1 Jun 2022 14:20:43 +0200 Subject: [PATCH 2/2] override hibernate with the productized version --- pom.xml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/pom.xml b/pom.xml index 3a4e305..05727bc 100644 --- a/pom.xml +++ b/pom.xml @@ -100,7 +100,44 @@ org.springframework.boot spring-boot-starter-data-jpa + + + org.hibernate + hibernate-core + + + + + + org.hibernate.validator + hibernate-validator + 6.0.22.Final-redhat-00002 + + + + + org.hibernate + hibernate-core + 5.3.24.Final-redhat-00001 + + + org.apache.geronimo.specs + geronimo-jta_1.1_spec + + + + + org.hibernate + hibernate-entitymanager + 5.3.24.Final-redhat-00001 + + + org.apache.geronimo.specs + geronimo-jta_1.1_spec + + + org.springframework.boot spring-boot-starter-actuator