Quarkus: Regression in 1.7.0.CR1: Maven build fails with "Failure to find org.gradle:gradle-tooling-api:jar:6.5"

Created on 1 Aug 2020  路  14Comments  路  Source: quarkusio/quarkus

Describe the bug
Switching from 1.6.1.Final to 1.7.0.CR1 in an _existing Maven project_ results in a build failure:

[INFO] Building middleware-shared-test-quarkus 0.1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.gradle:gradle-tooling-api:jar:6.5 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.455 s
[INFO] Finished at: 2020-08-01T01:06:46+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project middleware-shared-test-quarkus: Could not resolve dependencies for project com.somecompany.someproject.middleware:middleware-shared-test-quarkus:jar:0.1.0-SNAPSHOT: Failure to find org.gradle:gradle-tooling-api:jar:6.5 in https://artifacts.somecompany.de/artifactory/prj-someproject-build-release was cached in the local repository, resolution will not be reattempted until the update interval of someproject-release has elapsed or updates are forced -> [Help 1]

Yes, this is behind a corporate Artifactory server acting as a "proxy".

Expected behavior
I can just build/test my project with Maven as before, without adding any Gradle repos.

Actual behavior
Build fails until I add https://repo.gradle.org/gradle/libs-releases to the Maven repositories in pom.xml (or to my Artifactory virtual repo).

To Reproduce
Steps to reproduce the behavior:

  1. n/a at this time

Configuration
n/a

Environment (please complete the following information):

  • Output of uname -a or ver: MINGW64_NT-10.0-18363 XXX 3.0.7-338.x86_64 2019-11-21 23:07 UTC x86_64 Msys
  • Output of java -version: OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
  • GraalVM version (if different from Java): n/a
  • Quarkus version or git rev: 1.7.0.CR1
  • Build tool (ie. output of mvnw --version or gradlew --version): Apache Maven 3.6.3

Additional context
After adding the repo, mvn dependency:tree shows:

[INFO] +- io.quarkus:quarkus-junit5:jar:1.7.0.CR1:compile
[INFO] |  +- io.quarkus:quarkus-bootstrap-core:jar:1.7.0.CR1:compile
[INFO] |  |  +- io.quarkus:quarkus-bootstrap-app-model:jar:1.7.0.CR1:compile
[INFO] |  |  +- io.quarkus:quarkus-bootstrap-maven-resolver:jar:1.7.0.CR1:compile
[...]
[INFO] |  |  +- io.quarkus:quarkus-bootstrap-gradle-resolver:jar:1.7.0.CR1:compile
[INFO] |  |  |  \- org.gradle:gradle-tooling-api:jar:6.5:compile

It seems gradle-tooling-api 6.5 is not available via Maven central (repo1) or jcenter (these are the repos we have in our Artifactory virtual project repo).

The dependency was added here (transitively): https://github.com/quarkusio/quarkus/pull/10459/files#diff-e1d523d28b6eb842a1debab1b74c3297

I guess either the dependency has to be marked optional somehow, or the Migration Guide has to be updated to mention that you might need to add the Gradle repo.

aregradle aremaven kinbug

Most helpful comment

We have that repository somewhere

Root pom.xml it is: https://github.com/quarkusio/quarkus/pull/10459/files#diff-600376dffeb79835ede4a0b285078036
Please don't see this as finger pointing. I am merely gathering all info so that we can make a good decision on how to solve this.

even excluding it doesn't fix the issue

This works for me:

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-junit5</artifactId>
    <exclusions>
        <exclusion>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-bootstrap-gradle-resolver</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<plugin>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>build</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-bootstrap-core</artifactId>
            <version>${quarkus.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-bootstrap-gradle-resolver</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
</plugin>

I haven't checked dev mode yet, but I guess it should also work with this exclusion.

All 14 comments

/cc @quarkusio/devtools, @glefloch
/cc @quarkusio/devtools

Yes this dependency is not in maven central but in a Gradle repository, I don't know how we can change this

Interesting that didn't (doesn't?) show up in our Quarkus CI jobs.

Yeah, not having CI failing is very astonishing.

I'm also quite surprised we try to drag Gradle in a Maven project?

@famod can you try excluding this io.quarkus:quarkus-bootstrap-gradle-resolver dependency? If it works, that would allow you to test CR1 further.

I'll have a look tomorrow.

We have that repository somewhere, in build-parent IIRC (writing on the phone).

What puzzles me is that on my private Windows box the dependeny is found/downloaded.
So after all it might only be a problem for corporate Artifactory/Nexus "proxy" setups.
But I'll re-check that as well.

I have the same issue, even excluding it doesn't fix the issue

   > Could not find org.gradle:gradle-tooling-api:6.5.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/gradle/gradle-tooling-api/6.5/gradle-tooling-api-6.5.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.

@mahieddine Is that with a custom remote repository like Artifactory or Nexus?

@famod no i'm using jcenter/mavenCentral

Ok, thanks. So it is a _general_ problem.

This dependency is used to connect to a Gradle project in order to "discover" the project.
This allows to run tests or a main directly from the IDE.
I added the Gradle repository because this dependency provided by Gradle is not available on maven central.

We have that repository somewhere

Root pom.xml it is: https://github.com/quarkusio/quarkus/pull/10459/files#diff-600376dffeb79835ede4a0b285078036
Please don't see this as finger pointing. I am merely gathering all info so that we can make a good decision on how to solve this.

even excluding it doesn't fix the issue

This works for me:

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-junit5</artifactId>
    <exclusions>
        <exclusion>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-bootstrap-gradle-resolver</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<plugin>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>build</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-bootstrap-core</artifactId>
            <version>${quarkus.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-bootstrap-gradle-resolver</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
</plugin>

I haven't checked dev mode yet, but I guess it should also work with this exclusion.

This should be fixed in CR2 now available.

Confirmed, thanks!

Was this page helpful?
0 / 5 - 0 ratings