From 1153a1fe969f43b32b39f4d33cc4dee71047374d Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Sun, 14 Jan 2024 11:15:01 -0600 Subject: [PATCH] Allow samples to be run from IntelliJ or bootRun This commit adjust the `spring.docker.compose.file` property value to allow running the sample via IntelliJ "run" button or from command line via `./gradlew bootRun`. --- .../sample-failover-custom-router/build.gradle | 2 ++ .../src/main/resources/application.yml | 1 + .../sample-imperative-produce-consume/build.gradle | 2 ++ .../src/main/resources/application.yml | 1 + 4 files changed, 6 insertions(+) diff --git a/spring-pulsar-sample-apps/sample-failover-custom-router/build.gradle b/spring-pulsar-sample-apps/sample-failover-custom-router/build.gradle index 5baa3542..fc0495b1 100644 --- a/spring-pulsar-sample-apps/sample-failover-custom-router/build.gradle +++ b/spring-pulsar-sample-apps/sample-failover-custom-router/build.gradle @@ -48,4 +48,6 @@ bootRun { "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/sun.net=ALL-UNNAMED" ] + // when run from command line, path must be set relative to module dir + systemProperty 'spring.docker.compose.file', 'compose.yaml' } diff --git a/spring-pulsar-sample-apps/sample-failover-custom-router/src/main/resources/application.yml b/spring-pulsar-sample-apps/sample-failover-custom-router/src/main/resources/application.yml index 7267f11a..d5178113 100644 --- a/spring-pulsar-sample-apps/sample-failover-custom-router/src/main/resources/application.yml +++ b/spring-pulsar-sample-apps/sample-failover-custom-router/src/main/resources/application.yml @@ -4,4 +4,5 @@ spring: message-routing-mode: custompartition docker: compose: + # when run from Intellij via "Run" button, path must be set from project root file: spring-pulsar-sample-apps/sample-failover-custom-router/compose.yaml diff --git a/spring-pulsar-sample-apps/sample-imperative-produce-consume/build.gradle b/spring-pulsar-sample-apps/sample-imperative-produce-consume/build.gradle index 20a25897..b4db9da8 100644 --- a/spring-pulsar-sample-apps/sample-imperative-produce-consume/build.gradle +++ b/spring-pulsar-sample-apps/sample-imperative-produce-consume/build.gradle @@ -47,4 +47,6 @@ bootRun { "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/sun.net=ALL-UNNAMED" ] + // when run from command line, path must be set relative to module dir + systemProperty 'spring.docker.compose.file', 'compose.yaml' } diff --git a/spring-pulsar-sample-apps/sample-imperative-produce-consume/src/main/resources/application.yml b/spring-pulsar-sample-apps/sample-imperative-produce-consume/src/main/resources/application.yml index 3be2f167..c47b8e27 100644 --- a/spring-pulsar-sample-apps/sample-imperative-produce-consume/src/main/resources/application.yml +++ b/spring-pulsar-sample-apps/sample-imperative-produce-consume/src/main/resources/application.yml @@ -8,4 +8,5 @@ spring: schema-type: JSON docker: compose: + # when run from Intellij via "Run" button, path must be set from project root file: spring-pulsar-sample-apps/sample-imperative-produce-consume/compose.yaml