From 8c4e3a9e0112cbcd2d8ced251025f9c149a93dc0 Mon Sep 17 00:00:00 2001 From: Dariusz Zbyrad Date: Sun, 27 Oct 2024 20:55:13 +0100 Subject: [PATCH 1/2] Use Maven Wrapper in CI Workflows and Update Dependencies --- .github/workflows/build.yml | 6 +++++- .github/workflows/release.yml | 10 +++++++--- README.md | 9 +++++---- .../com/pi4j/spring/boot/ContextTest.java | 2 +- pom.xml | 20 +++++++++---------- 5 files changed, 28 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bad0ae5..e8f3047 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,11 @@ jobs: java-version: 17 distribution: 'zulu' + # Ensure Maven wrapper is executable + - name: Make Maven Wrapper executable + run: chmod +x ./mvnw + # Build and run tests - name: Maven package run: | - mvn -ntp -B package + ./mvnw -ntp -B package diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7dc7388..743cc70 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,11 +25,15 @@ jobs: java-version: 17 distribution: 'zulu' + # Ensure Maven wrapper is executable + - name: Make Maven Wrapper executable + run: chmod +x ./mvnw + # Prepare for upload to Maven Central # https://jreleaser.org/guide/latest/examples/maven/staging-artifacts.html - name: Build for release run: | - mvn -ntp -B -Ppublication deploy -DaltDeploymentRepository=local::file:./target/staging-deploy + ./mvnw -ntp -B -Ppublication deploy -DaltDeploymentRepository=local::file:./target/staging-deploy - name: List files staged for release run: | @@ -45,7 +49,7 @@ jobs: JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - mvn -ntp -B jreleaser:config + ./mvnw -ntp -B jreleaser:config # Only release when approved - name: Get release approval @@ -65,4 +69,4 @@ jobs: JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - mvn -ntp -B jreleaser:full-release + ./mvnw -ntp -B jreleaser:full-release diff --git a/README.md b/README.md index 0f7d73c..97e7641 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,8 @@ $ sdk install java 17.0.7-zulu ```shell $ git clone https://github.com/Pi4J/pi4j-springboot.git $ cd pi4j-springboot -$ mvn package +$ chmod +x mvnw +$ ./mvnw package ``` * Run it as sudo to make sure Pi4J starts correctly. @@ -65,7 +66,7 @@ $ mvn package $ sudo java -jar pi4j-spring-boot-starter-sample-app/target/pi4j-spring-boot-starter-sample-app-0.0.1.ea.jar # Or when installed with SDKMAN -$ sudo ~/.sdkman/candidates/java/19.0.2-zulu/bin/java -jar pi4j-spring-boot-starter-sample-app/target/pi4j-spring-boot-starter-sample-app-0.0.1.ea.jar +$ sudo ~/.sdkman/candidates/java/17.0.7-zulu/bin/java -jar pi4j-spring-boot-starter-sample-app/target/pi4j-spring-boot-starter-sample-app-0.0.1.ea.jar ``` * Check the output of the application: @@ -94,7 +95,7 @@ $ sudo ~/.sdkman/candidates/java/19.0.2-zulu/bin/java -jar pi4j-spring-boot-star ... ``` -* Open browser with http://{RASPBERRY_PI_IP_ADDRESS}:8080/actuator/info +* Open browser with `http://{RASPBERRY_PI_IP_ADDRESS}:8080/actuator/info` * Output on a Raspberry Pi 4 (but truncated the pins-section): ```json { @@ -159,4 +160,4 @@ $ sudo ~/.sdkman/candidates/java/19.0.2-zulu/bin/java -jar pi4j-spring-boot-star This project was started by Daniel Frey and got further improved by DaShaun Carter during a few live-coding sessions: 1. [Working on Pi4J Spring Boot](https://www.twitch.tv/videos/1828406758) -1. [Spring Boot Pi4J Starter :: Testing my PR](https://www.twitch.tv/videos/1829189803) \ No newline at end of file +1. [Spring Boot Pi4J Starter :: Testing my PR](https://www.twitch.tv/videos/1829189803) diff --git a/pi4j-spring-boot/src/test/java/com/pi4j/spring/boot/ContextTest.java b/pi4j-spring-boot/src/test/java/com/pi4j/spring/boot/ContextTest.java index 5cdfcb7..4159249 100644 --- a/pi4j-spring-boot/src/test/java/com/pi4j/spring/boot/ContextTest.java +++ b/pi4j-spring-boot/src/test/java/com/pi4j/spring/boot/ContextTest.java @@ -22,7 +22,7 @@ void contextLoads() { } @Test - void boardUnkownIfNotRunningOnPi() { + void boardUnknownIfNotRunningOnPi() { String osName = System.getProperty("os.name").toLowerCase(); String osArch = System.getProperty("os.arch").toLowerCase(); if (osName.contains("linux") && osArch.contains("arm")) { diff --git a/pom.xml b/pom.xml index d9e972f..0ef1351 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.springframework.boot spring-boot-starter-parent - 3.2.5 + 3.3.4 @@ -19,12 +19,12 @@ 17 - 3.2.5 + 3.3.4 2.7.0 - 0.8.10 - 1.3.1 + 0.8.12 + 1.14.0 @@ -85,27 +85,27 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0 + 3.6.3 org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.13.0 org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.10.1 org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.4.2 org.apache.maven.plugins maven-sources-plugin - 3.2.1 + 3.15.0 @@ -182,7 +182,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.1 attach-sources From 12eb9ab343495f7e393ca5716278b5c165448dc9 Mon Sep 17 00:00:00 2001 From: Dariusz Zbyrad Date: Sun, 27 Oct 2024 21:04:46 +0100 Subject: [PATCH 2/2] Fix MD formatting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 97e7641..7483f8d 100644 --- a/README.md +++ b/README.md @@ -160,4 +160,4 @@ $ sudo ~/.sdkman/candidates/java/17.0.7-zulu/bin/java -jar pi4j-spring-boot-star This project was started by Daniel Frey and got further improved by DaShaun Carter during a few live-coding sessions: 1. [Working on Pi4J Spring Boot](https://www.twitch.tv/videos/1828406758) -1. [Spring Boot Pi4J Starter :: Testing my PR](https://www.twitch.tv/videos/1829189803) +2. [Spring Boot Pi4J Starter :: Testing my PR](https://www.twitch.tv/videos/1829189803)