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

Regression: Mix Kotlin and Java classes in multi-module projects breaks dev mode with Gradle #27005

Open
OscarRL opened this issue Jul 28, 2022 · 7 comments
Labels

Comments

@OscarRL
Copy link

OscarRL commented Jul 28, 2022

Describe the bug

When using a multi-module project and mixing Kotlin and Java classes on /src/main/java and /src/test/java at the same time dev mode doesn't detect any class.

Actually the reproducer that I added shows that no JAX-RS endpoints are detected but this reproducer you can also create @startup classes and hooks and it will be ignored by Quarkus Dev Mode.

Expected behavior

All Java and Kotlin classes must be detected and running. Endpoints should be detected, swagger working and live deployment running.

Actual behavior

JAX-RS Endpoints are not detected.
ApplicationScoped classes are not detected.
@startup events are not trigged or classes with this annotations are not detected.

In general seems like the main package does not exist. Only the lib package.

How to Reproduce?

[](url
reproducer-kotlin-mix.zip
)

Go to app folder and run the project. Then enter go to the browser and you will see that there is no endpoints. And dev mode endpoints also doesn't show.

  1. cd ./app
  2. ../gradlew clean quarkusDev
  3. Go to http://localhost:8080

As additional step you can create a class to monitor lifecycle following : https://quarkus.io/guides/lifecycle and you will see that no messages will appear.

If you run the project on production build or test build it will work as expected.

If you remove any java/kotlin classes to let only Kotlin or Java classes on the project it will work as expected.

Output of uname -a or ver

Ubuntu && Arch Linux reproduced

Output of java -version

17 and 11

GraalVM version (if different from Java)

Quarkus version or git rev

2.11.1 ( happends since 2.7.X )

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

gradlew 7.3.3

Additional information

The app submodule has the depenency

quarkusDev(testFixtures(project(":lib")))

If you remove it the project will crash with :

WARN  [io.qua.arc.pro.BeanArchives] (build-12) Failed to index org.acme.test.AbstractBaseTest: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader: DEV@2fb0623e

Do not check this. The textFixtures is just to demonstrate how we use quarkus if you remove the dependencies and fix the compiling errors on the tests the behavior will be the same as mentioned on the description.

This is another reason why we think that quarkusDev is not loading main(src, test) project classes.

@OscarRL OscarRL added the kind/bug Something isn't working label Jul 28, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 28, 2022

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

@OscarRL OscarRL changed the title Regresion: Mix Kotlin and Java classes in multi-module projects breaks dev mode with Gradle Regression: Mix Kotlin and Java classes in multi-module projects breaks dev mode with Gradle Jul 28, 2022
@OscarRL
Copy link
Author

OscarRL commented Sep 7, 2022

Still happens on 2.12.0.Final upgrading Kotlin to 1.7.10

@gsmet
Copy link
Member

gsmet commented Sep 7, 2022

@evanchooly could you have a look at that one? There is a reproducer in the description.

@OscarRL
Copy link
Author

OscarRL commented Sep 29, 2022

Any news about this ?

This thing doesn't allow us to upgrade our Quarkus.

We tested 2.13.0.Final.

@holly-cummins
Copy link
Contributor

@OscarRL, I'm wondering if #29697 might fix things (although it's unrelated to the regression since the classloading behaviour it's changing is quite old). I'll have a try with your reproducer and report back.

@holly-cummins
Copy link
Contributor

Sadly, no dice. I can confirm this still happens on HEAD as of today.

@OscarRL
Copy link
Author

OscarRL commented Dec 20, 2022

Sadly, no dice. I can confirm this still happens on HEAD as of today.

Thank you for your test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants