You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2021/05/08 21:34:12 UTC
[maven-surefire] 01/02: [SUREFIRE-1912] user.dir should not be set
lazily within the surefire fork JVM
This is an automated email from the ASF dual-hosted git repository.
tibordigana pushed a commit to branch userDir
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit e324af522507e919c16a17f2d80935e2cc110f31
Author: tibordigana <ti...@gmail.com>
AuthorDate: Tue May 4 21:54:02 2021 +0200
[SUREFIRE-1912] user.dir should not be set lazily within the surefire fork JVM
---
.../org/apache/maven/plugin/surefire/AbstractSurefireMojo.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index 18cfa72..d95c6a5 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -1222,7 +1222,6 @@ public abstract class AbstractSurefireMojo
getUserProperties(), sysProps );
result.setProperty( "basedir", getBasedir().getAbsolutePath() );
- result.setProperty( "user.dir", getWorkingDirectory().getAbsolutePath() );
result.setProperty( "localRepository", getLocalRepository().getBasedir() );
if ( isForking() )
{
@@ -1246,10 +1245,16 @@ public abstract class AbstractSurefireMojo
);
}
}
+ else
+ {
+ result.setProperty( "user.dir", getWorkingDirectory().getAbsolutePath() );
+ }
+
if ( getConsoleLogger().isDebugEnabled() )
{
showToLog( result, getConsoleLogger() );
}
+
return result;
}