Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle reactive project errors when the maven one doesn't. #20767

Closed
sixcorners opened this issue Oct 14, 2021 · 4 comments · Fixed by #21019
Closed

Gradle reactive project errors when the maven one doesn't. #20767

sixcorners opened this issue Oct 14, 2021 · 4 comments · Fixed by #21019
Labels
area/gradle Gradle area/kotlin area/maven env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@sixcorners
Copy link

Describe the bug

If I generate a reactive project the maven version works and the gradle one doesn't.
I made projects with the dependencies described here: https://quarkus.io/guides/getting-started-reactive
code-with-quarkus (5).zip
code-with-quarkus (4).zip

Expected behavior

App starts

Actual behavior

Gradle project gives me this:
Caused by: io.quarkus.runtime.configuration.ConfigurationException: Unable to find a JDBC driver corresponding to the database kind 'postgresql' for the default datasource. Either provide a suitable JDBC driver extension, define the driver manually, or disable the JDBC datasource by adding 'quarkus.datasource.jdbc=false' to your configuration if you don't need it.

How to Reproduce?

Run
./gradlew quarkusDev
and
./mvnw quarkus:dev

Output of uname -a or ver

ver : The term 'ver' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Output of java -version

openjdk version "11.0.12" 2021-07-20 OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7) OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.3.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

------------------------------------------------------------ Gradle 7.2 ------------------------------------------------------------ Build time: 2021-08-17 09:59:03 UTC Revision: a773786b58bb28710e3dc96c4d1a7063628952ad Kotlin: 1.5.21 Groovy: 3.0.8 Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020 JVM: 11.0.12 (Eclipse Foundation 11.0.12+7) OS: Windows 10 10.0 amd64

Additional information

No response

@sixcorners sixcorners added the kind/bug Something isn't working label Oct 14, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 14, 2021

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

@briancullen
Copy link

I have also just come across this, glad to see I'm not the only one. I don't know if it helps but adding quarkus.datasource.jdbc=false does let the application start and work as the error message suggests. There is, however, still a INFO message from Agroal saying it is there but it can't find any datasource to attach to.

@marcelkliemannel
Copy link

I encourage the same problem. After some debugging I think the difference between both projects is that the Gradle one has the Agrogal extension added by default, but the Maven one does not.

If I add the Agrogal extension to the Maven project:

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-agroal</artifactId>
</dependency>

the same exception occurs.

Excluding the Agroal dependency completely from the Gradle project didn't work (resulted in a ClassNotFoundException: io.quarkus.agroal.runtime.metrics.AgroalMetricsRecorder ). However, excluding the quarkus-agroal-deployment dependency worked as a work around:

configurations.all {
  exclude(group = "io.quarkus", module = "quarkus-agroal-deployment")
}

@glefloch
Copy link
Member

Rigth, the way gradle handle dependency exclusion is different from what maven do.
I'm testing a fix that adds some exclusion in the reactive library. I should have a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle area/kotlin area/maven env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants