Our multi project has over 50 subprojects with various inter dependencies. During an incremental rebuild, even for UP-TO-DATE, javaCompile dominates build time. On average, rebuild runs up to 2 minutes. I looked into javaCompile.inputs and it appears to be set to runtimeClasspath, dragging in every JAR on the classpath. I imagine this is the root cause of slowness since Gradle has to calculate “up-to-dateness” with what it cached last time.

Is there way to speed up javaCompile tasks

  1. by removing JAR files from inputs?
  2. any other way to fix incremental build time for large Gradle 6.4 multi-projects?

Related post: