Is it possible to change the classpath string of the startScripts for the application plugin?

We have an application that has a large amount of submodules and a large amount of external dependencies. When trying to use the application plugin to build a zip of the application, it seems to work fine in Linux and on Cygwin. On windows however, the command line is too long due to the number of jars in the classpath. I manually edited the classpath in the script to replace the line with:

set CLASSPATH=%APP_HOME%\lib\main.jar;%APP_HOME%\lib\*

This makes the app work, but I am unsure how to set the classpath to that using the build script, since the settable classpath seems to take files. Is there any way to just replace the classpath string altogether? Or at least accomplish what I am going for?

I think your best chance is to post-process the generated startup script (using Gradle/Groovy).

Okay, that is what I was planning to do if there was not a built in way to do it. Thanks!