Issue
I'm starting with Quarkus using Maven and can't seem to find a solution to this:
I have a Quarkus app with dependencies on the libraries A
and B
. Both are imported as "Modules" (not Maven modules!) in the IntelliJ IDEA project for my app.
When starting Quarkus in dev mode, it ignores the classes in target/
of A
and B
and instead loads them from the Maven repository. Therefore with every change in either A
or B
, I have to mvn install
the respective library, so my Quarkus app uses the correct code.
Coming from Thorntail, this was not necessary. Is there a solution that doesn't require auto-installing A
and B
on every build and also makes HotSwap work for those libs?
Edit:
As @CrazyCoder requested, here's a minimal example of my pom.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<quarkus-plugin.version>1.8.3.Final</quarkus-plugin.version>
<quarkus.platform.version>1.8.3.Final</quarkus.platform.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-universe-bom</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>A</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>B</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
A
and B
are listed in IntelliJ IDEA under "Project Structure... > Modules > test > Dependencies" as Module Depenencies, not Maven Dependencies. So the code in A
and B
should be HotSwappable.
Solution
I eventually found the solution. As so often: Once you know it, it's trivial.
Open your run configuration, expand the Environment
dropdown (only populated when an application module is selected) and check the option Resolve Workspace artifacts
:
Answered By - Neon
Answer Checked By - Candace Johnson (JavaFixing Volunteer)