diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/RunIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/RunIntegrationTests.java index 0b83d8b376..33719a7bc3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/RunIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/RunIntegrationTests.java @@ -85,14 +85,14 @@ class RunIntegrationTests { @TestTemplate void whenCommandLineSpecifiesJvmArgumentsTheyAreAvailableToTheApplication(MavenBuild mavenBuild) { mavenBuild.project("run-jvmargs-commandline").goals("spring-boot:run") - .systemProperty("spring-boot.run.jvmArguments", "\"-Dfoo=value1\" \"-Dbar=value2\"") + .systemProperty("spring-boot.run.jvmArguments", "-Dfoo=value-from-cmd") .execute((project) -> assertThat(buildLog(project)).contains("I haz been run")); } @TestTemplate void whenPomAndCommandLineSpecifyJvmArgumentsThenPomOverrides(MavenBuild mavenBuild) { mavenBuild.project("run-jvmargs").goals("spring-boot:run") - .systemProperty("spring-boot.run.jvmArguments", "\"-Dfoo=value-from-cmd\"") + .systemProperty("spring-boot.run.jvmArguments", "-Dfoo=value-from-cmd") .execute((project) -> assertThat(buildLog(project)).contains("I haz been run")); } @@ -117,7 +117,7 @@ class RunIntegrationTests { @TestTemplate void whenAWorkingDirectoryIsConfiguredTheApplicationIsRunFromThatDirectory(MavenBuild mavenBuild) { mavenBuild.project("run-working-directory").goals("spring-boot:run").execute( - (project) -> assertThat(buildLog(project)).containsPattern("I haz been run from.*/src/main/java")); + (project) -> assertThat(buildLog(project)).containsPattern("I haz been run from.*src.main.java")); } @TestTemplate diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvmargs-commandline/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvmargs-commandline/src/main/java/org/test/SampleApplication.java index 75bd969535..4a22cbb289 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvmargs-commandline/src/main/java/org/test/SampleApplication.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvmargs-commandline/src/main/java/org/test/SampleApplication.java @@ -20,13 +20,9 @@ public class SampleApplication { public static void main(String[] args) { String foo = System.getProperty("foo"); - if (!"value1".equals(foo)) { + if (!"value-from-cmd".equals(foo)) { throw new IllegalStateException("foo system property mismatch (got [" + foo + "]"); } - String bar = System.getProperty("bar"); - if (!"value2".equals(bar)) { - throw new IllegalStateException("bar system property mismatch (got [" + bar + "]"); - } System.out.println("I haz been run"); }