Skip to content

Commit b2d70d3

Browse files
committed
Merge branch 'GrigorievNick-add-custom-wroking-dir'
2 parents 0a8cc67 + d61e298 commit b2d70d3

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<groupId>org.scalatest</groupId>
1414
<artifactId>scalatest-maven-plugin</artifactId>
1515
<packaging>maven-plugin</packaging>
16-
<version>2.0.2</version>
16+
<version>2.0.3</version>
1717
<name>ScalaTest Maven Plugin</name>
1818
<description>Integrates ScalaTest into Maven</description>
1919
<url>https://www.scalatest.org/user_guide/using_the_scalatest_maven_plugin</url>

src/main/java/org/scalatest/tools/maven/AbstractScalaTestMojo.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,13 @@ abstract class AbstractScalaTestMojo extends AbstractMojo {
227227
*/
228228
double spanScaleFactor = 1.0;
229229

230+
/**
231+
* The current working directory for forked process. Optional. If not specified, basedir will be used.
232+
*
233+
* @parameter property="workingDirectory"
234+
*/
235+
String workingDirectory;
236+
230237
// runScalaTest is called by the concrete mojo subclasses TODO: make it protected and others too
231238
// Returns true if all tests pass
232239
boolean runScalaTest(String[] args) throws MojoFailureException {
@@ -262,7 +269,11 @@ private boolean runWithoutForking(String[] args) {
262269
private boolean runForkingOnce(String[] args) throws MojoFailureException {
263270

264271
final Commandline cli = new Commandline();
265-
cli.setWorkingDirectory(project.getBasedir());
272+
if ((this.workingDirectory == null || this.workingDirectory.isEmpty())) {
273+
cli.setWorkingDirectory(project.getBasedir());
274+
} else {
275+
cli.setWorkingDirectory(workingDirectory);
276+
}
266277
cli.setExecutable(getJvm());
267278

268279
// Set up environment

0 commit comments

Comments
 (0)