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

Quarkus output class in incorrect folder on live reload (gradle, multimodule, kotlin) #42860

Closed
ylemoigne opened this issue Aug 29, 2024 · 1 comment · Fixed by #42913
Closed
Labels
area/gradle Gradle area/kotlin kind/bug Something isn't working
Milestone

Comments

@ylemoigne
Copy link

Describe the bug

In a gradle project with :

  • a common module using java+kotlin+jandex
  • an app module using java+quarkus

Once the app started, if we modify a java source of the common module
And trigger a live reload
Then the java class is produced in common/build/resources directory rather than common/build/classes directory.

Once this has happened, app restart won't work with message like :

Execution failed for task ':common:jar'.
> Entry fr/common/Foo.class is a duplicate but no duplicate handling strategy has been set

Expected behavior

On live reload recompilation, classes should be produced in build/classes directory ; (event if there is the kotlin plugin)

Actual behavior

Class produced in resource folder leading to on future start :

Execution failed for task ':common:jar'.
> Entry fr/common/Foo.class is a duplicate but no duplicate handling strategy has been set

How to Reproduce?

quarkus-bug-common-lib.zip

Using the attached zip, launch ./gradlew :app:quarkusDev
Modifiy common/src/main/java/fr/common/Foo.java (even the comment line).
Open browser to http://localhost:8080 to trigger a live reload.

See that common/build/resources contains file fr/common/Foo.class
Stop the app with Ctrl+c, then launch again ./gradlew :app:quarkusDev
Error about duplicate resource when executing jar task (because the class file is both in build/classes and build/ressources)

Output of uname -a or ver

Darwin MacBook-Pro-de-Yann.local 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020 arm64

Output of java -version

openjdk version "21.0.3" 2024-04-16 LTS OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode)

Quarkus version or git rev

3.13.3

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

Gradle 8.8

Additional information

No response

@ylemoigne ylemoigne added the kind/bug Something isn't working label Aug 29, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 29, 2024

/cc @geoand (kotlin), @glefloch, @quarkusio/devtools

gsmet added a commit to gsmet/quarkus that referenced this issue Aug 30, 2024
We were returning an empty dir before which would trigger the use of the
resources dir instead.

Also simplify the logic as it was quite hard to follow and it's actually
quite simple.

Fixes quarkusio#42860
gsmet added a commit to gsmet/quarkus that referenced this issue Aug 30, 2024
We were returning an empty dir before which would trigger the use of the
resources dir instead.

Also simplify the logic as it was quite hard to follow and it's actually
quite simple.

Fixes quarkusio#42860
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Aug 31, 2024
@gsmet gsmet modified the milestones: 3.16 - main, 3.14.2 Sep 2, 2024
gsmet added a commit to gsmet/quarkus that referenced this issue Sep 2, 2024
We were returning an empty dir before which would trigger the use of the
resources dir instead.

Also simplify the logic as it was quite hard to follow and it's actually
quite simple.

Fixes quarkusio#42860

(cherry picked from commit 6394622)
gsmet added a commit to gsmet/quarkus that referenced this issue Sep 3, 2024
We were returning an empty dir before which would trigger the use of the
resources dir instead.

Also simplify the logic as it was quite hard to follow and it's actually
quite simple.

Fixes quarkusio#42860

(cherry picked from commit 6394622)
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Sep 20, 2024
We were returning an empty dir before which would trigger the use of the
resources dir instead.

Also simplify the logic as it was quite hard to follow and it's actually
quite simple.

Fixes quarkusio#42860
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle area/kotlin kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants