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

Hot reload does not build multi module project in correct order #24384

Closed
Postremus opened this issue Mar 17, 2022 · 2 comments · Fixed by #24534
Closed

Hot reload does not build multi module project in correct order #24384

Postremus opened this issue Mar 17, 2022 · 2 comments · Fixed by #24534
Labels
area/devmode kind/bug Something isn't working
Milestone

Comments

@Postremus
Copy link
Member

Describe the bug

I have a multi module project, where I get exceptions on hot reload.
If I only change one module at a time (and hot reload), no exception is thrown.

If i change multiple modules at the same time however, I get the exception from below.

In a related bug, #23164, only one additionalModule existed other than the applicationArchive. #24187 was the fix for that situation.

However, in my real world applications, I have a few modules more.. about 20 of them iirc.

My project structure looks like this:
parent

  • service (business logic)
  • rest (web stuff, has dependency on service)
  • backend (module containing the quarkus plugin, has dependency on rest)

Doing a change in service (e.g. adding a method), using the new method in rest, and then reloading the changes in these 2 modules causes the exception.

Expected behavior

Hot reload works flawlessly even when changing multiple modules at once.

Actual behavior

Listening for transport dt_socket at address: 5005
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2022-03-17 20:17:21,863 INFO  [io.quarkus] (Quarkus Main Thread) backend 1.0.0-SNAPSHOT on JVM (powered by Quarkus 999-SNAPSHOT) started in 1.481s. Listening on: http://localhost:8080

2022-03-17 20:17:21,875 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2022-03-17 20:17:21,876 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy-reactive, smallrye-context-propagation, vertx]                                                                                                                            
                                                                                                                                       
--                                                                                                                                     
Compilation Failed:                                                                                                                    
C:\Users\Martin\IdeaProjects\ap-test\rest\src\main\java\org\acme\rest\ExampleResource.java:24: error: method greet in class org.acme.service.ExampleService cannot be applied to given types;                                                                                 
        return service.greet("Quarkus");                                                                                               
                      ^                                                                                                                
  required: java.lang.String,java.lang.String                                                                                          
  found:    java.lang.String                                                                                                           
  reason: actual and formal argument lists differ in length     

How to Reproduce?

Download the reproducer:
ap-test.zip

  1. mvn clean compile quarkus:dev
  2. open dev ui - this works
  3. In org.acme.service.ExampleService, adder another parameter to greet()
  4. In org.acme.rest.ExampleResource, change the resource to call the changed greet method.
  5. reload the dev ui
  6. compilation error from above happens
  7. Stop quarkus
  8. mvn clean compile quarkus:dev
  9. open dev ui - this works. The source itself is compileable by maven, but not by quarkus.

Output of uname -a or ver

Microsoft Windows [Version 10.0.22000.556]

Output of java -version

openjdk 17.0.1 2021-10-19 OpenJDK Runtime Environment Temurin-17.0.1+12 (build 17.0.1+12) OpenJDK 64-Bit Server VM Temurin-17.0.1+12 (build 17.0.1+12, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.7.5.Final

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

Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739) Maven home: C:\tools\java\maven Java version: 17.0.1, vendor: Eclipse Adoptium, runtime: C:\tools\java\17-temurin Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Additional information

No response

@Postremus Postremus added the kind/bug Something isn't working label Mar 17, 2022
@quarkus-bot quarkus-bot bot added env/windows Impacts Windows machines triage/needs-triage labels Mar 17, 2022
@Postremus Postremus added area/devmode and removed env/windows Impacts Windows machines triage/needs-triage labels Mar 17, 2022
@Postremus
Copy link
Member Author

FTR. DevModeContext#additionalModules has the modules sorted like:

  • rest
  • service

In this constellation, hot reload fails.

If I now switch them around (in my debugger), so that service is before rest, it works.

/cc @aloubyansky fyi. This might be related with how the maven plugin resolves dependencies.

@aloubyansky
Copy link
Member

Thanks for the report @Postremus

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

Successfully merging a pull request may close this issue.

3 participants