You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "olamy (via GitHub)" <gi...@apache.org> on 2026/06/04 06:35:53 UTC

Re: [PR] Fix: resolve relative classpath elements against the fork's working dir [maven-surefire]

olamy commented on code in PR #3333:
URL: https://github.com/apache/maven-surefire/pull/3333#discussion_r3353992820


##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ClasspathForkConfiguration.java:
##########
@@ -77,9 +78,11 @@ protected void resolveClasspath(
             @Nonnull Commandline cli,
             @Nonnull String booterThatHasMainMethod,
             @Nonnull StartupConfiguration config,
+            @Nonnull File workingDirectory,
             @Nonnull File dumpLogDirectory)
             throws SurefireBooterForkException {
-        cli.addEnvironment("CLASSPATH", join(toCompleteClasspath(config).iterator(), File.pathSeparator));
+        List<String> classpath = toCompleteClasspath(config);
+        cli.addEnvironment("CLASSPATH", join(classpath.iterator(), File.pathSeparator));

Review Comment:
   please limit non needed changes or point via a comment the real fix



##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfiguration.java:
##########
@@ -153,7 +154,8 @@ public Commandline createCommandLine(
         try {
             Commandline cli = new Commandline(getExcludedEnvironmentVariables());
 
-            cli.setWorkingDirectory(getWorkingDirectory(forkNumber).getAbsolutePath());
+            File cwd = getWorkingDirectory(forkNumber);
+            cli.setWorkingDirectory(cwd.getAbsolutePath());

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org