We work on rewriting the build system for a software company. Their build has lots of generators, that use various 3rd party deps, one of them is whole Weblogic. We have a "depchain" pom, that consists of all weblogic dependencies. When we run some kind of generators with this depchain in classpath, we fail on CreateProcess error=206, The filename or extension is too long on 32 bit JVM, but everything works well with 64. It's quite obvious, that it fails on the length of the classpath, because every jar in the depchain is the absolute location within .m2 folder (previously they did not have the understanding of binary repository and the classpath was a simple directory). We execute generators with simple antrun plugin executions. Is there a way to make it work on 32bit java, besides trimming the classpath?
UPD After a day of sweating I finally made it working using @Evgeniy Dorofeev 's idea. I couldn't use mvn plugin because the part of creating the artifact I run in, is executing this generator. So I had to use ant to build a manifest only jar that contains this giant classpath string. The issue that the classpath string used absolute paths, and I had to convert it to relative (MANIFEST.MF format). It was a headache of it's own:
<var name="relative.classpath.property"/> <for param="curr.dep" list="${combined_classpath}" delimiter=";"> <sequential> <local name="relative.dep.location"/> <property name="relative.dep.location" relative="true" basedir="${project.build.directory}" value="@{curr.dep}"/> <local name="classpath.hack.temp"/> <propertyregex property="classpath.hack.temp" input="${relative.dep.location}" regexp="\\" replace="\/" default="${relative.dep.location}" global="true"/> <var name="relative.classpath.property" value="${relative.classpath.property} ${classpath.hack.temp}"/> </sequential> </for> And to build a jar with all this stuff later:
<jar jarfile="${project.build.directory}/classpath.hack.jar"> <manifest> <attribute name="Class-Path" value="${relative.classpath.property}"/> </manifest> </jar> And then my <java> will have only ${project.build.directory}/classpath.hack.jar in the classpath