allJars

@get:PathSensitive(value = PathSensitivity.ABSOLUTE)
@get:InputFiles
abstract val allJars: ListProperty<RegularFile>

This needs to use InputFiles and PathSensitivity.ABSOLUTE because the path to the jars really does matter here. Using Classpath is an error, as it looks only at content and not name or path, and we really do need to know the actual path to the artifact, even if its contents haven't changed.