Skip to content

Commit 593d20e

Browse files
committed
Add ability to customize working directory of forked process
1 parent 832678c commit 593d20e

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

pom.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<groupId>org.scalatest</groupId>
1212
<artifactId>scalatest-maven-plugin</artifactId>
1313
<packaging>maven-plugin</packaging>
14-
<version>2.0.2</version>
14+
<version>2.0.3</version>
1515
<name>ScalaTest Maven Plugin</name>
1616
<description>Integrates ScalaTest into Maven</description>
1717

@@ -73,6 +73,19 @@
7373
</developer>
7474
</developers>
7575

76+
<distributionManagement>
77+
<repository>
78+
<id>central</id>
79+
<name>AppsFlyer Artifactory-releases</name>
80+
<url>https://artifactory.appsflyer.com:443/artifactory/maven</url>
81+
</repository>
82+
<snapshotRepository>
83+
<id>snapshots</id>
84+
<name>AppsFlyer Artifactory-snapshots</name>
85+
<url>https://artifactory.appsflyer.com/artifactory/maven-snapshots/</url>
86+
</snapshotRepository>
87+
</distributionManagement>
88+
7689
<dependencies>
7790
<dependency>
7891
<groupId>org.apache.maven</groupId>
@@ -215,6 +228,9 @@
215228
<execution>
216229
<id>sign-artifacts</id>
217230
<phase>verify</phase>
231+
<configuration>
232+
<skip>true</skip>
233+
</configuration>
218234
<goals>
219235
<goal>sign</goal>
220236
</goals>

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

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

227+
/**
228+
* The current working directory for forked process. Optional. If not specified, basedir will be used.
229+
*
230+
* @parameter property="workingDirectory"
231+
*/
232+
String workingDirectory;
233+
227234
// runScalaTest is called by the concrete mojo subclasses TODO: make it protected and others too
228235
// Returns true if all tests pass
229236
boolean runScalaTest(String[] args) throws MojoFailureException {
@@ -259,7 +266,11 @@ private boolean runWithoutForking(String[] args) {
259266
private boolean runForkingOnce(String[] args) throws MojoFailureException {
260267

261268
final Commandline cli = new Commandline();
262-
cli.setWorkingDirectory(project.getBasedir());
269+
if ((this.workingDirectory == null || this.workingDirectory.isEmpty())) {
270+
cli.setWorkingDirectory(project.getBasedir());
271+
} else {
272+
cli.setWorkingDirectory(workingDirectory);
273+
}
263274
cli.setExecutable(getJvm());
264275

265276
// Set up environment

0 commit comments

Comments
 (0)