apache / apache/maven-surefire
Use argument file for starting surefire
- Dominant language
- Java
- Stars
- 461
- Forks
- 588
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 19
Description
### New feature, improvement proposal
Currently you have the option of using regular arguments or using a manifest only JAR to control the classpath for surefire.
The Manifest JAR is a workaround for windows and long command lines.
However, Java has (since java11) had an inbuilt way to handle this using [argument files](https://docs.oracle.com/en/java/javase/11/tools/java.html#GUID-3B1CE181-CD30-4178-9602-230B800D4FAE__GUID-36C0C35E-403B-4A05-9C54-0CBE7D237C1C).
This option is needed on Windows where the maven repository and source code (or even a split repository) may be on different drives, as without this you will always encounter a `dumpstream` containing something like:
```
# Created at 2025-05-08T11:59:58.265
Boot Manifest-JAR contains absolute paths in classpath 'D:\source\github\xxx\target\test-classes'
Hint: -Djdk.net.URLClassPath.disableClassPathURLCheck=true
'other' has different root
```
Whilst surefire still works, and this option could be added by using an argument file no workarounds would be necessary with that option, and if < java11 support was ever dropped then the launcher code could be simplified to a single implementation.
Contributor guide
Research direction
Start by locating the Surefire launcher code that chooses between regular arguments and a manifest-only JAR, then compare the Java 11 argument-file requirements. Reproduce the Windows cross-drive case described in the issue and verify that starting Surefire works through the new option without the reported dumpstream workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100