Skip to content

Commit bf670d0

Browse files
committed
Merge branch '2.1.x'
Closes gh-16960
2 parents babb94c + 60d60a8 commit bf670d0

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/src/main/java/org/test/SampleApplication.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,10 +16,12 @@
1616

1717
package org.test;
1818

19+
import java.io.File;
20+
1921
public class SampleApplication {
2022

2123
public static void main(String[] args) {
22-
System.out.println("I haz been run");
24+
System.out.println("I haz been run from '" + new File("").getAbsolutePath() + "'");
2325
}
2426

2527
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
def file = new File(basedir, "build.log")
2-
return file.text.contains("I haz been run")
2+
return file.text.contains("I haz been run from '$basedir'")
33

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ private void doRunWithForkedJvm(String startClassName)
287287
addClasspath(args);
288288
args.add(startClassName);
289289
addArgs(args);
290-
runWithForkedJvm(this.workingDirectory, args, determineEnvironmentVariables());
290+
runWithForkedJvm(
291+
(this.workingDirectory != null) ? this.workingDirectory
292+
: this.project.getBasedir(),
293+
args, determineEnvironmentVariables());
291294
}
292295

293296
/**

0 commit comments

Comments
 (0)