question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maven multi module project with Quarkus in dev mode not working as expected

See original GitHub issue

Hi,

I am new to Quarkus and try to use it in a Maven multi module project. My project is structured as followed:

- quarkustest (pom)
  - quarkustest-application (jar)
  - quarkustest-backend (pom)
    - quarkustest-backend-rest-api (jar)
  - quarkustest-dependencies (pom)
  - quarkustest-parent (pom)

The application module executes the quarkus-maven-plugin with build-goal. The quarkustest-backend-rest-api contains a simple REST controller and thus also a beans.xml in /src/main/resources/META-INF. The rest-api-module is references by the application module.

If I package the whole project with mvn package, the resulting runner-jar works as expected. However, if I try to start the project in dev mode with mvn compile quarkus:dev, I get following exception:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.0.0.Final:dev (default-cli) on project quarkustest-application: Failed to run: Failed to resolve Quarkus application model: Failed to resolve dependencies for de.rhocas.quarkustest:quarkustest-application:jar:1.0.0-SNAPSHOT: Could not find artifact de.rhocas.quarkustest:quarkustest-backend-rest-api:jar:1.0.0-SNAPSHOT -> [Help 1]

If I install the dependencies via mvn install, it works, but changes in the backend API are still not reflected in the running application.

I uploaded my example project here: https://github.com/nils-christian/quarkus-multi-module-issue

Expected behavior

The expected behaviour would be that changes in other modules are reflected in the application while in dev mode.

Actual behavior

Changes in other modules are not visible in the application while in dev mode.

Environment (please complete the following information):

  • Output of uname -a or ver: Linux debian 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux
  • Output of java -version: openjdk version “11.0.5” 2019-10-15
  • GraalVM version (if different from Java): 19.2.1
  • Quarkus version or git rev: 1.0.0.Final

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bhabeggercommented, May 28, 2020

FYI, this works better (I don’t know for hot reload) when running the app. At least at startup the code is in sync:

mvn quarkus:dev -pl <project> --also-make

-pl is to select the modules to be run –also-make is to ensure depedencies get built

0reactions
stuartwdouglascommented, Jul 8, 2020

This works now, except for the linked issue related to how the project was structured. If you remove the parent from the top level project everthing should work fine on 1.5.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maven multi module project with Quarkus in dev mode
The application module executes the quarkus-maven-plugin with build-goal. The quarkustest-backend-rest-api contains a simple REST controller and ...
Read more >
Building applications with Maven - Quarkus
You can scaffold a new Maven project with: CLI. Maven ... You should not run production application in dev mode. ... Working with...
Read more >
maven release + generate/public image - Google Groups
to Quarkus Development mailing list. Have multi module project and the quarkus project is a submodule ./mvnw package -Dquarkus.container-image.build=true ...
Read more >
Chapter 5. Creating a Quarkus Maven project using code ...
As an application developer, you can use code.quarkus.redhat.com to generate a Quarkus Maven project and automatically add and configure the extensions that ...
Read more >
Developer mode and multi-module maven projects : r/quarkus
Hello fellow quarkons! I have quality-of-life question: how do you handle dev mode with multi-module maven projects (and no parent/child ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found