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

Running gradle quarkusDev fails in a multi-module Gradle project #23776

Closed
tabuyos opened this issue Feb 17, 2022 · 5 comments · Fixed by #23881
Closed

Running gradle quarkusDev fails in a multi-module Gradle project #23776

tabuyos opened this issue Feb 17, 2022 · 5 comments · Fixed by #23881
Labels
area/gradle Gradle env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@tabuyos
Copy link

tabuyos commented Feb 17, 2022

Describe the bug

I am learning the tutorial: GETTING STARTED WITH REACTIVE

When I run gradle :quarkus-reactive:quarkusDev in a multi-module gradle project, I get an exception

Execution failed for task ':quarkus-reactive:compileJava'.
> Cannot change dependencies of dependency configuration ':quarkus-reactive:annotationProcessor' after it has been included in dependency resolution. Use 'defaultDependencies' instead of 'beforeResolve' to specify default dependencies for a configuration.

When I comment out implementation("io.quarkus:quarkus-hibernate-reactive-panache") it works fine

Expected behavior

This Quarkus plugin should work fine in other submodules

Actual behavior

this Quarkus plugin doesn't seem to be able to execute compileJava task in submodule

How to Reproduce?

Here is my example code:

reproduce/quarkus at main · tabuyos/reproduce

Execute the gradle :quarkus-reactive:quarkusDev task in the quarkus directory

Output of uname -a or ver

Microsoft Windows [version 10.0.19043.1466]

Output of java -version

openjdk version "16" 2021-03-16

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.7.1.Final

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

Gradle 7.0.2

Additional information

No response

@tabuyos tabuyos added the kind/bug Something isn't working label Feb 17, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Feb 17, 2022

/cc @glefloch, @quarkusio/devtools

@quarkus-bot quarkus-bot bot added area/gradle Gradle env/windows Impacts Windows machines labels Feb 17, 2022
@ngarg-panw
Copy link

ngarg-panw commented Feb 17, 2022

Facing the same issue after I upgraded my Quarkus from 2.0.0.CR3 to 2.7.1.Final

Could not determine the dependencies of task ':quarkusBuild'.
> Cannot change dependencies of dependency configuration ':annotationProcessor' after it has been included in dependency resolution. Use 'defaultDependencies' instead of 'beforeResolve' to specify default dependencies for a configuration.

Also, same as mentioned above:
When I comment out implementation("io.quarkus:quarkus-hibernate-reactive-panache") it works fine

@glefloch
Copy link
Member

Thanks for reporting this @tabuyos. Could you try to remove configuration related settings in your main build.gradle (from line 47 to 55) ?

@ngarg-panw
Copy link

ngarg-panw commented Feb 17, 2022

@glefloch I have similar code as @tabuyos .

  configureEach {
    exclude(module = "slf4j-log4j12")
    exclude(module = "slf4j-jboss-logmanager")
  }
  val apc = get("annotationProcessor")
  get("compileOnly").extendsFrom(apc)
  get("testCompileOnly").extendsFrom(apc)
}

But when I comment the lines suggested by you. In my case, following lines:

val apc = get("annotationProcessor")
get("compileOnly").extendsFrom(apc)
get("testCompileOnly").extendsFrom(apc)

I start getting errors for Json annotations and lombok annotations that they are not found.

@glefloch
Copy link
Member

yes, the issue comes from the fact that we add a dependency to the annotationProcessor configuration if a panache artifact is present. I will push a fix.

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

Successfully merging a pull request may close this issue.

3 participants