GoogleCloudPlatform / artifact-registry-maven-tools

Apache License 2.0
22 stars 23 forks source link

Configuration Cache compatibility with Gradle 8.1+ #85

Open Naitbit opened 1 year ago

Naitbit commented 1 year ago

When trying to use artifactregistry-gradle-plugin:2.2.0 with Configuartion Cache Gradle 8.1 it errors out with:

1 problem was found storing the configuration cache.

Naitbit commented 1 year ago

Still happens with artifactregistry-gradle-plugin:2.2.1 Gradle 8.1.1 Linked docs

Naitbit commented 1 year ago

I've created Proof of Concept that updates Gradle plugin to Gradle 8.1.1 and fixes the configuration cache issue. https://github.com/Naitbit/artifact-registry-maven-tools/commit/35f6c550428c2752f4a6c085bb43aa9872af7e37 To be complete it would also require making compatibility adjustments in Maven Wagon, which I don't use and didn't test.

bjoernmayer commented 4 months ago

Any news on this? Or workarounds?

Naitbit commented 4 months ago

Well I did build my branch locally and put .jar as dependency. It fixed CC complain, but I'm not vouching for my accidental fork.

jjohannes commented 4 months ago

As workaround, you can apply the plugin conditionally only for publishing builds. It's not very nice but works. This means:

if (!serviceOf<BuildFeatures>().configurationCache.active.get()) {
    apply(plugin = "com.google.cloud.artifactregistry.gradle-plugin")
}

In real project: https://github.com/hashgraph/hedera-services/blob/8432c100bf4ac9d6a417dac2d9b544d4dc9f6380/build-logic/project-plugins/src/main/kotlin/com.hedera.hashgraph.platform-maven-publish.gradle.kts#L25-L30

bjoernmayer commented 4 months ago

Won't work for us. We are using the plugin mainly to handle the access to the artifact maven repo. I am considering to create a PR for this repo with a fix, that is based on Naitbits fork

bjoernmayer commented 3 months ago

I've created a new Gradle Plugin: https://github.com/bjoernmayer/artifactregistry-gradle