Skip to content

Publishing Gradle plugins to Ivy is not compatible with the configuration cache #24537

@mlopatkin

Description

@mlopatkin

Expected Behavior

Gradle plugins should be publishable to Ivy repositories with java-gradle-plugin when configuration cache is enabled.

Current Behavior

Configuration cache errors appear:

cannot serialize object of type org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublication, a subtype of org.gradle.api.publish.Publication, as these are not supported with the configuration cache.
field val$mainPublication of org.gradle.plugin.devel.plugins.IvyPluginPublishingPlugin$3
 bean of type org.gradle.plugin.devel.plugins.IvyPluginPublishingPlugin$3
  field this$1 of org.gradle.plugin.devel.plugins.IvyPluginPublishingPlugin$3$2
   bean of type org.gradle.plugin.devel.plugins.IvyPluginPublishingPlugin$3$2
    field delegate of org.gradle.api.internal.UserCodeAction
     bean of type org.gradle.api.internal.UserCodeAction
      field singleAction of org.gradle.internal.ImmutableActionSet$SingletonSet
       bean of type org.gradle.internal.ImmutableActionSet$SingletonSet
        field actions of org.gradle.internal.MutableActionSet
         bean of type org.gradle.internal.MutableActionSet
          field actions of org.gradle.internal.xml.XmlTransformer
           bean of type org.gradle.internal.xml.XmlTransformer
            field xmlTransformer of org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator$DescriptorFileSpec
             bean of type org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator$DescriptorFileSpec
              field value of org.gradle.internal.Try$Success
               bean of type org.gradle.internal.Try$Success
                field result of org.gradle.internal.serialization.Cached$Fixed
                 bean of type org.gradle.internal.serialization.Cached$Fixed
                  field ivyDescriptorSpec of org.gradle.api.publish.ivy.tasks.GenerateIvyDescriptor
                   task:generateDescriptorFileForGoodbyePluginMarkerIvyPublication of type org.gradle.api.publish.ivy.tasks.GenerateIvyDescriptor
                   task:generateDescriptorFileForHelloPluginMarkerIvyPublication of type org.gradle.api.publish.ivy.tasks.GenerateIvyDescriptor

Context

We strive to make all bundled plugins compatible with the configuration cache

Steps to Reproduce

Run ./gradlew -PrunBrokenConfigurationCacheDocsTests=true -PenableConfigurationCacheForDocsTests=true :docs:docsTest --tests='*snippet-plugins-publishing_*_publishToIvy.sample*'

Your Environment

Build scan URL: https://ge.gradle.org/s/p2cnp7gqimr7e

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions