Optimizing Gradle Builds in Jenkins Pipeline

I have a project that is successfully building with gradle, and also created a jenkins pipeline for it.

The pipeline is written so that the ‘build’, ‘test’, ‘publishCoverageReport’ steps all happen in their own stage.

TLDR Here is the problem: It seems like the configuration part of the gradle build process happens regardless of whether or not it has already been performed for a prior build stage. Is there any way to do it just once? ( without bunching all desired gradle tasks into a single command on one line like “./gradlew clean build test publishCoverageReport doOtherStuffA doOtherStuffB”

At the moment there is not. If the stages share a common Gradle daemon then the configuration time would be minimized.

There is a configuration cache feature in development and available for testing/experimentation.