Open eygraber opened 3 years ago
I'll add support for it once the underlying Maven Publish and Signing plugins support configuration caching on the Gradle side https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:plugins
maven-publish
itself supports cc since 7.6 and the signing
plugin will in Gradle 8.1. However there is one big open blocker when publishing to maven central https://github.com/gradle/gradle/issues/22779. When configuration cache is enabled the repository url will be evaluated eagerly and not when the publishing tasks are executed. Since we are computing that url based on the output of the task that creates the staging repo the build will fail with this:
Configuration cache state could not be cached: field `repository` of `org.gradle.api.publish.maven.tasks.PublishToMavenRepository$PublishSpec` bean found in field `value` of `org.gradle.internal.Try$Success` bean found in field `result` of `org.gradle.internal.serialization.Cached$Fixed` bean found in field `spec` of task `:nexus:publishMavenPublicationToMavenCentralRepository` of type `org.gradle.api.publish.maven.tasks.PublishToMavenRepository`: error writing value of type 'org.gradle.api.publish.maven.tasks.PublishToMavenRepository$RepositorySpec$Configured'
> Cannot query the value of this provider because it has no value available.
The value of this provider is derived from:
- task ':nexus:createStagingRepository' property 'stagingRepositoryId'
So current status:
With Gradle 8.1 being out the updated status is that config cache is supported in all scenarios except for:
Looks like there are some issues with using this plugin when the configuration cache is enabled. Not sure if any of this is internal to Gradle or part of the plugin, but figured I'd record it here.
Here's a build of mine that failed because of it.