From c63191aaaef4320b7b5918ac4e905360b87ddad0 Mon Sep 17 00:00:00 2001 From: Robert McNees Date: Wed, 7 Aug 2024 07:05:41 -0400 Subject: [PATCH] Update dependabot and Gradle files This commit changes the dependency-management plugin in Gradle build files so that the version number is not set excplicitly but rather managed by Boot. --- .github/dependabot.yml | 32 ++++++++++++++ complete/build.gradle | 3 +- initial/build.gradle | 3 +- test/expected-first.json | 1 - test/expected-second.json | 1 - test/run.sh | 91 --------------------------------------- 6 files changed, 36 insertions(+), 95 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100644 test/expected-first.json delete mode 100644 test/expected-second.json delete mode 100755 test/run.sh diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e440161 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,32 @@ +version: 2 +updates: + + - package-ecosystem: "maven" + directories: + - "/initial" + - "/complete" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-patch"] + schedule: + interval: "monthly" + target-branch: "main" + groups: + guide-dependencies-maven: + patterns: + - "*" + + - package-ecosystem: "gradle" + directories: + - "/initial" + - "/complete" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-patch"] + schedule: + interval: "monthly" + target-branch: "main" + groups: + guide-dependencies-gradle: + patterns: + - "*" \ No newline at end of file diff --git a/complete/build.gradle b/complete/build.gradle index 700c2bd..007c580 100644 --- a/complete/build.gradle +++ b/complete/build.gradle @@ -1,9 +1,10 @@ plugins { id 'org.springframework.boot' version '3.3.0' - id 'io.spring.dependency-management' version '1.1.5' id 'java' } +apply plugin: 'io.spring.dependency-management' + group = 'com.example' version = '0.0.1-SNAPSHOT' sourceCompatibility = '17' diff --git a/initial/build.gradle b/initial/build.gradle index cea2d81..2bb0e9f 100644 --- a/initial/build.gradle +++ b/initial/build.gradle @@ -1,9 +1,10 @@ plugins { id 'org.springframework.boot' version '3.3.0' - id 'io.spring.dependency-management' version '1.1.5' id 'java' } +apply plugin: 'io.spring.dependency-management' + group = 'com.example' version = '0.0.1-SNAPSHOT' sourceCompatibility = '17' diff --git a/test/expected-first.json b/test/expected-first.json deleted file mode 100644 index d67e2f0..0000000 --- a/test/expected-first.json +++ /dev/null @@ -1 +0,0 @@ -{"id":1,"content":"Hello, World!"} diff --git a/test/expected-second.json b/test/expected-second.json deleted file mode 100644 index f620d57..0000000 --- a/test/expected-second.json +++ /dev/null @@ -1 +0,0 @@ -{"id":2,"content":"Hello, World!"} diff --git a/test/run.sh b/test/run.sh deleted file mode 100755 index b485697..0000000 --- a/test/run.sh +++ /dev/null @@ -1,91 +0,0 @@ -cd $(dirname $0) -cd ../complete -./mvnw clean package -java -jar target/rest-service-cors-complete-0.0.1-SNAPSHOT.jar & -PID=$! -sleep 15 -curl -s http://localhost:8080/greeting > target/actual.json -curl -s http://localhost:8080/greeting-javaconfig > target/actual-javaconfig.json -kill -9 $PID - -echo "Let's look at the actual results: `cat target/actual.json`" -echo "And compare it to: `cat ../test/expected-first.json`" - -if diff -w ../test/expected-first.json target/actual.json - then - echo SUCCESS - let ret=0 - else - echo FAIL - let ret=255 - exit $ret -fi - -echo "Let's look at the actual results: `cat target/actual-javaconfig.json`" -echo "And compare it to: `cat ../test/expected-second.json`" - -if diff -w ../test/expected-second.json target/actual-javaconfig.json - then - echo SUCCESS - let ret=0 - else - echo FAIL - let ret=255 - exit $ret -fi - -rm -rf target - -./gradlew clean build -java -jar build/libs/rest-service-cors-0.0.1-SNAPSHOT.jar & -PID=$! -sleep 15 -curl -s http://localhost:8080/greeting > build/actual.json -curl -s http://localhost:8080/greeting-javaconfig > build/actual-javaconfig.json -kill -9 $PID - -echo "Let's look at the actual results: `cat build/actual.json`" -echo "And compare it to: `cat ../test/expected-first.json`" - -if diff -w ../test/expected-first.json build/actual.json - then - echo SUCCESS - let ret=0 - else - echo FAIL - let ret=255 - exit $ret -fi - -echo "Let's look at the actual results: `cat build/actual-javaconfig.json`" -echo "And compare it to: `cat ../test/expected-second.json`" - -if diff -w ../test/expected-second.json build/actual-javaconfig.json - then - echo SUCCESS - let ret=0 - else - echo FAIL - let ret=255 - exit $ret -fi - -rm -rf build - -cd ../initial - -./mvnw clean compile -ret=$? -if [ $ret -ne 0 ]; then -exit $ret -fi -rm -rf target - -./gradlew clean compileJava -ret=$? -if [ $ret -ne 0 ]; then -exit $ret -fi -rm -rf build - -exit