Maven surefire tests fail on Windows when maven local repository lies under directory containing space
envgap__jenkinsci__jenkins-26122
01 / FAILURE SIGNATURE
As reported upstream
[ERROR] Error occurred during initialization of VMError opening zip file or JAR manifest missing : C:\Users\K
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
1ce1de6cf587fb39d32ae7ae9bb622f597ef5f67- Manifest
core/pom.xml- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
jenkinsci/jenkins #26122 · read the original issue
### Jenkins and plugins versions report <details> <summary>Environment</summary> <!-- Paste your environment details below --> ```text OS: Windows 11 JDK: Eclipse Temurin 21.0.9 Maven: 3.9.11 Maven surefire plugin: 3.5.4 Jenkins: 2.547-SNAPSHOT ``` </details> ### What Operating System are you using (both controller, and any agents involved in the problem)? Windows 11 ### Reproduction steps 1. Make sure the Maven local repository path has any parent directory containing space. Usually a windows user containing space for e.g: `C:\Users\Any Thing\.m2\repository\...`. 2. Run `mvn clean test` in the Jenkins repo. ### Expected Results Tests run and pass without any issue. ### Actual Results <details> <summary>Test crashes:</summary> <!-- Paste your environment details below --> ```text [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [ERROR] Error occurred during initialization of VMError opening zip file or JAR manifest missing : C:\Users\K [INFO] [INFO] Results: [INFO] [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] [WARNING] Corrupted channel by directly writing to native stream in forked JVM 1. See FAQ web page and the dump file C:\Jenkins test\jenkins\core\target\surefire-reports\2026-01-15T22-07-02_519-jvmRun1.dumpstream [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for Jenkins main module 2.547-SNAPSHOT: [INFO] [INFO] Jenkins main module ................................ SUCCESS [02:31 min] [INFO] Jenkins BOM ........................................ SUCCESS [ 0.724 s] [INFO] Internal SPI for WebSocket ......................... SUCCESS [ 5.160 s] [INFO] Jetty 12 (EE 9) implementation for WebSocket ....... SUCCESS [ 1.855 s] [INFO] Jenkins cli ........................................ SUCCESS [ 10.495 s] [INFO] Jenkins core ....................................... FAILURE [01:08 min] [INFO] Jenkins war ........................................ SKIPPED [INFO] Tests for Jenkins core ............................. SKIPPED [INFO] Jenkins coverage ................................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 04:12 min [INFO] Finished at: 2026-01-15T22:08:22+05:30 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.4:test (default-test) on project jenkins-core: [ERROR] [ERROR] See C:\Jenkins test\jenkins\core\target\surefire-reports for the individual test results. [ERROR] See dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] ExecutionException The forked VM terminated without properly saying goodbye. VM crash or System.exit called? [ERROR] Command was cmd.exe /X /C ""C:\Users\K K\.jdks\temurin-21.0.9\bin\java" --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -javaagent:C:\Users\K K\.m2\repository\org\mockito\mockito-core\5.21.0\mockito-core-5.21.0.jar -jar "C:\Users\K K\AppData\Local\Temp\surefire4649124214375539255\surefirebooter-20260115220822591_3.jar" "C:\Users\K K\AppData\Local\Temp\surefire4649124214375539255" 2026-01-15T22-07-02_519-jvmRun1 surefire-20260115220822591_1tmp surefire_0-20260115220822591_2tmp" [ERROR] Error occurred in starting fork, check output in log [ERROR] Process Exit Code: 1 [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: ExecutionException The forked VM terminated without properly saying goodbye. VM crash or System.exit called? [ERROR] Command was cmd.exe /X /C ""C:\Users\K K\.jdks\temurin-21.0.9\bin\java" --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -javaagent:C:\Users\K K\.m2\repository\org\mockito\mockito-core\5.21.0\mockito-core-5.21.0.jar -jar "C:\Users\K K\AppData\Local\Temp\surefire4649124214375539255\surefirebooter-20260115220822591_3.jar" "C:\Users\K K\AppData\Local\Temp\surefire4649124214375539255" 2026-01-15T22-07-02_519-jvmRun1 surefire-20260115220822591_1tmp surefire_0-20260115220822591_2tmp" [ERROR] Error occurred in starting fork, check output in log [ERROR] Process Exit Code: 1 [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.awaitResultsDone(ForkStarter.java:456) [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.runSuitesForkPerTestSet(ForkStarter.java:418) [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:297) [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:250) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1337) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1135) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:969) [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162) [ERROR] at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73) [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173) [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101) [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:906) [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283) [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:206) [ERROR] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:580) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:255) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:201) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:361) [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:314) [ERROR] Caused by: org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called? [ERROR] Command was cmd.exe /X /C ""C:\Users\K K\.jdks\temurin-21.0.9\bin\java" --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -javaagent:C:\Users\K K\.m2\repository\org\mockito\mockito-core\5.21.0\mockito-core-5.21.0.jar -jar "C:\Users\K K\AppData\Local\Temp\surefire4649124214375539255\surefirebooter-20260115220822591_3.jar" "C:\Users\K K\AppData\Local\Temp\surefire4649124214375539255" 2026-01-15T22-07-02_519-jvmRun1 surefire-20260115220822591_1tmp surefire_0-20260115220822591_2tmp" [ERROR] Error occurred in starting fork, check output in log [ERROR] Process Exit Code: 1 ``` </details> ### Anything else? This happens because `-javaagent` path for Mockito in core's pom.xml is not properly quoted. ### Are you interested in contributing a fix? Yes
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]