fabric8io / kubernetes-client

Java client for Kubernetes & OpenShift
http://fabric8.io
Apache License 2.0
3.38k stars 1.46k forks source link

Fail to build Fabric8 :: Java generator :: Gradle Plugin #6163

Open jorsol opened 1 month ago

jorsol commented 1 month ago

Describe the bug

Building the project using mvn clean package -DskipTests and fails with:

...
17:24:35.433 [INFO] Fabric8 :: Java generator :: Gradle Plugin ......... FAILURE [  0.082 s]
17:24:35.433 [INFO] Fabric8 :: Java generator :: Maven Plugin .......... SKIPPED
17:24:35.433 [INFO] Fabric8 :: Java generator :: Integration Tests ..... SKIPPED
17:24:35.433 [INFO] Fabric8 :: Java generator :: Benchmarks ............ SKIPPED
17:24:35.433 [INFO] Fabric8 :: Kubernetes :: HttpClient :: Vert.x ...... SKIPPED
17:24:35.433 [INFO] Fabric8 :: Kubernetes :: Dependency Compatibility :: Tests SKIPPED
17:24:35.433 [INFO] Fabric8 :: Kubernetes :: Bouncy Castle FIPS Compatibility :: Test SKIPPED
17:24:35.433 [INFO] Fabric8 :: Kubernetes :: Log4j Core components ..... SKIPPED
17:24:35.433 [INFO] Fabric8 :: Kubernetes :: HttpClient :: JDK ......... SKIPPED
17:24:35.433 [INFO] Fabric8 :: Kubernetes :: HttpClient :: Jetty ....... SKIPPED
17:24:35.433 [INFO] Fabric8 :: Kubernetes :: HttpClient Tests .......... SKIPPED
17:24:35.433 [INFO] Kube API Test Parent ............................... SKIPPED
17:24:35.433 [INFO] Kube API Test ...................................... SKIPPED
17:24:35.433 [INFO] Kube API Test - Client Injecting Support ........... SKIPPED
17:24:35.433 [INFO] ------------------------------------------------------------------------
17:24:35.433 [INFO] BUILD FAILURE
17:24:35.433 [INFO] ------------------------------------------------------------------------
17:24:35.433 [INFO] Total time:  08:01 min
17:24:35.433 [INFO] Finished at: 2024-07-19T17:24:35+02:00
17:24:35.433 [INFO] ------------------------------------------------------------------------
17:24:35.434 [ERROR] Failed to execute goal on project io.fabric8.java-generator.gradle.plugin: Could not resolve dependencies for project io.fabric8.java-generator:io.fabric8.java-generator.gradle.plugin:jar:7.0-SNAPSHOT
17:24:35.434 [ERROR] dependency: org.gradle:gradle-tooling-api:jar:8.5 (provided)
17:24:35.434 [ERROR]    org.gradle:gradle-tooling-api:jar:8.5 was not found in https://repo1.maven.org/maven2/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of maven-central has elapsed or updates are forced
17:24:35.434 [ERROR]    org.gradle:gradle-tooling-api:jar:8.5 was not found in https://repo.gradle.org/gradle/libs-releases-local/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of repo.gradle.org has elapsed or updates are forced
17:24:35.434 [ERROR]    org.gradle:gradle-tooling-api:jar:8.5 was not found in https://repo.gradle.org/gradle/ext-releases-local/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of ext.repo.gradle.org has elapsed or updates are forced
17:24:35.434 [ERROR]    org.gradle:gradle-tooling-api:jar:8.5 was not found in https://repo1.maven.org/maven2/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of sonatype-maven-org has elapsed or updates are forced
17:24:35.434 [ERROR]    org.gradle:gradle-tooling-api:jar:8.5 was not found in https://maven-central-eu.storage-download.googleapis.com/maven2/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of google-maven-central has elapsed or updates are forced

Fabric8 Kubernetes Client version

SNAPSHOT

Steps to reproduce

mvn clean package -DskipTests

Expected behavior

Build success

Runtime

Kubernetes (vanilla)

Kubernetes API Server version

1.25.3@latest

Environment

Linux

Fabric8 Kubernetes Client Logs

No response

Additional context

No response

manusa commented 1 month ago

This is known problem with com.marcnuri.plugins:gradle-api-maven-plugin.

Originally tracked in https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/package.20org.2Egradle.2Ewrapper.20does.20not.20exist/

It happens because the content of one of the Gradle distribution jars is different if downloaded from Maven Central or the Gradle distribution itself.

Gradle exposes a tiny fraction of their distribution Jars in Maven Central. It also adds additional stuff to these Jars so there's no need to publish additional artifacts that contain some of the other required classes present in the standard distribution.

The gradle-api-maven-plugin downloads the jars from the standard Gradle distribution and places them in your local Maven repository.

If you're building Quarkus and the Fabric8 Kubernetes Client, depending on which project you built first, you might get these sort of problems when building the Gradle-related modules for either project.

A simple mvn -U to force the download of the Gradle dependencies should fix the issue. Keep in mind that if then you switch to Quarkus you might need to do that there too.

The problem will be fixed one https://github.com/manusa/gradle-api-maven-plugin/pull/28 is merged.