From 48490d5d7c9297999428d3af4d5a8fb5c4290718 Mon Sep 17 00:00:00 2001 From: Adam Gent Date: Fri, 23 Aug 2024 17:41:50 -0400 Subject: [PATCH] Fix LoggingSystemFactory loading priority --- .github/workflows/maven.yml | 2 +- spring/rainbowgum-spring-boot-starter/pom.xml | 1 + .../src/main/java/module-info.java | 5 +++++ .../boot/RainbowGumLoggingSystemFactory.java | 3 +++ test/rainbowgum-test-spring-boot/pom.xml | 14 +++++--------- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 51868553..47a72376 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -38,7 +38,7 @@ jobs: name: test-results path: '**/target/surefire-reports/TEST-*.xml' - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} slug: jstachio/rainbowgum diff --git a/spring/rainbowgum-spring-boot-starter/pom.xml b/spring/rainbowgum-spring-boot-starter/pom.xml index f7fc349e..51b41c64 100644 --- a/spring/rainbowgum-spring-boot-starter/pom.xml +++ b/spring/rainbowgum-spring-boot-starter/pom.xml @@ -14,6 +14,7 @@ ${project.groupId} rainbowgum + runtime ${project.groupId} diff --git a/spring/rainbowgum-spring-boot-starter/src/main/java/module-info.java b/spring/rainbowgum-spring-boot-starter/src/main/java/module-info.java index 40b87917..0e830076 100644 --- a/spring/rainbowgum-spring-boot-starter/src/main/java/module-info.java +++ b/spring/rainbowgum-spring-boot-starter/src/main/java/module-info.java @@ -4,4 +4,9 @@ */ module io.jstach.rainbowgum.spring.boot.starter { requires static org.eclipse.jdt.annotation; + /* + * TODO For some reason Maven javadoc plugin thinks + * this is needed. + */ + requires io.jstach.rainbowgum.spring.boot; } \ No newline at end of file diff --git a/spring/rainbowgum-spring-boot/src/main/java/io/jstach/rainbowgum/spring/boot/RainbowGumLoggingSystemFactory.java b/spring/rainbowgum-spring-boot/src/main/java/io/jstach/rainbowgum/spring/boot/RainbowGumLoggingSystemFactory.java index e9c172ae..91b0a93d 100644 --- a/spring/rainbowgum-spring-boot/src/main/java/io/jstach/rainbowgum/spring/boot/RainbowGumLoggingSystemFactory.java +++ b/spring/rainbowgum-spring-boot/src/main/java/io/jstach/rainbowgum/spring/boot/RainbowGumLoggingSystemFactory.java @@ -15,6 +15,8 @@ import org.springframework.boot.logging.LoggingInitializationContext; import org.springframework.boot.logging.LoggingSystem; import org.springframework.boot.logging.LoggingSystemFactory; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; import org.springframework.core.env.Environment; import io.jstach.rainbowgum.LogConfig; @@ -28,6 +30,7 @@ * Creates the RainbowGum LoggingSystem that gets called by Spring Boot initializing its * logging. */ +@Order(value = Ordered.HIGHEST_PRECEDENCE) public class RainbowGumLoggingSystemFactory implements LoggingSystemFactory { /** diff --git a/test/rainbowgum-test-spring-boot/pom.xml b/test/rainbowgum-test-spring-boot/pom.xml index c9783616..ee59a21c 100644 --- a/test/rainbowgum-test-spring-boot/pom.xml +++ b/test/rainbowgum-test-spring-boot/pom.xml @@ -54,6 +54,11 @@ + + io.jstach.rainbowgum + rainbowgum-spring-boot-starter + ${project.version} + org.springframework.boot spring-boot-starter-web @@ -64,15 +69,6 @@ - - io.jstach.rainbowgum - rainbowgum - - - io.jstach.rainbowgum - rainbowgum-spring-boot-starter - ${project.version} -