My company uses Gradle to build Java projects. Our build farm runs on Linux boxes however a lot of our developers use Windows workstations. On Windows, some of our builds fail with the infamous error message “java.io.IOException: CreateProcess error=206, The filename or extension is too long”.
This occurs in the compilation step using Ant under the hood because the classpath exceeds Windows’ max length (about 8192 chars).
To workaround this issue, I thought about implementing the “pathing jar” approach described here: http://stackoverflow.com/questions/201816/how-to-set-a-long-java-classpath-in-msdos-windows/201969#201969 however this requires tuning the way Gradle invokes Ant. Instead of providing a (too long) list of jar paths, the tweak consists in generating a jar file that lists all those files for us.
I had a quick look at the Gradle source code (in 1.4, the version we use) but couldn’t find any callback / entry point to implement such a fix.
What’s the best approach to fix this issue ?