Note that this problem is more general in nature and perhaps not limited to this particular task class - the question really is what truly is the classpath of custom tasks and how to control it? How to add references to libs coming from/with Gradle itself?

As for what the true intent of the original implementation of the task is - it is to create an enhanced WAR file that for each relevant static content (name).(ext) file inside it creates a separate (name).(ext).gz entry if that is deemed beneficial. See: