Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration cache problems #259

Open
eygraber opened this issue May 21, 2021 · 4 comments
Open

Configuration cache problems #259

eygraber opened this issue May 21, 2021 · 4 comments
Labels

Comments

@eygraber
Copy link
Contributor

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.

@gabrielittner
Copy link
Collaborator

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

@gabrielittner
Copy link
Collaborator

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 gradle/gradle#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:

  • Gradle 7.6: publishing to local or non maven central remote repositories works with cc when signing is disabled
  • Gradle 8.1: publishing to local or non maven central remote repositories works with cc with signing enabled
  • TBD: publishing to maven central works with cc

@gabrielittner
Copy link
Collaborator

gabrielittner commented Apr 15, 2023

With Gradle 8.1 being out the updated status is that config cache is supported in all scenarios except for:

  • Publishing releases to Maven Central (snapshots are fine), blocked by Gradle issue #22779.
  • Kotlin Multiplatform projects, blocked by KT-49933.

@MV-GH
Copy link

MV-GH commented Nov 13, 2023

KT-49933 has been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants