Skip to content

Configuration cache incompatibility when using dockerCompose.exposeAsSystemProperties in doFirst block #452

Open
@wsutina

Description

@wsutina

I've encountered a configuration cache incompatible issue when using dockerCompose.exposeAsSystemProperties inside a doFirst block, following the guidance in the plugin's usage guide.

Code:

tasks.named<Test>("test") {
  doFirst {
    dockerCompose.exposeAsSystemProperties(this@named)
  }
}

Error:

Task `:service:test` of type `org.gradle.api.tasks.testing.Test`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.

See https://docs.gradle.org/8.10/userguide/configuration_cache.html#config_cache:requirements:disallowed_types

Given that the plugin should be configuration cache compatible (#307), could you please advise how this line should be used or if there is an alternative approach to achieve the same outcome?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions