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).
Hello Francois, as a first side note notice that the useAnt property in JavaCompile is deprecated in Gradle. Now to your question. I think one approach would be to reconfigure all your JavaCompile tasks in your builds and create a path jar in the doFirst block of the JavaCompile tasks or in a task your compile tasks depends on.
I’d be interested to hear why you are still using the Ant-based compiler integration. Gradle’s “native” compiler integration is faster, doesn’t suffer from such limitations, and is the way forward in general.
I understand your question. To be honest, there’s not a good reason for this. We migrated this year to Gradle. The migration job for this particular (huge, Rene knows) build was done by one team (not mine). The build is continuously maintained by a lot of people (not a single team) so there’s a really diffuse responsibility. In the end noone’s really responsible for ensuring we use the latest version of Gradle for instance. Likewise, it’s unclear who’s responsible for maintaining this huge build. Now I could switch to the native compiler but since I was never explained the very reason why we initially used Ant (and I’m pretty sure there’s a reason) my change will surely yield side effects.