1

I have the project (called tesa) constitued with two modules: tesa-app and tesa-domain

+ tesa (pom.xml)

+----tesa-modules (pom.xml)
   
+-------tesa-app (pom.xml)

+-------tesa-domain (pom.xml)

The problem is that, whenever I make a change to the tesa-domain module and than run ./mvnw -f modules/tesa-app/pom.xml compile quarkus:dev to start my quarkus app, the changes in the domain are not taken into account.

Thus every time I make a change to the domain, I need to run `mvn clean install. This is so annoying. The live reload is, a fortiori, not working as well.

Any idea how to fix this?


The outermost pom.xml

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.liv.services.doom</groupId>
  <artifactId>tesa</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <packaging>pom</packaging>

  <parent>
    <groupId>org.liv.services.core</groupId>
    <artifactId>quarkus-config</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../core/quarkus-config/pom.xml</relativePath>
  </parent>

  <modules>
    <module>modules</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.liv.services.doom</groupId>
        <artifactId>tesa-domain</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.liv.services.doom</groupId>
        <artifactId>tesa-app</artifactId>
        <version>${project.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
</project>

The modules pom.xml

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>tesa-modules</artifactId>
  <packaging>pom</packaging>

  <parent>
    <groupId>org.liv.services.doom</groupId>
    <artifactId>tesa</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <modules>
    <module>tesa-app</module>
    <module>tesa-domain</module>
  </modules>

  <dependencies>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-arc</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-junit5</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib-jdk8</artifactId>
    </dependency>
    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

The app pom.xml :

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.liv.services.doom</groupId>
  <artifactId>tesa-app</artifactId>

  <parent>
    <groupId>org.liv.services.doom</groupId>
    <artifactId>tesa-modules</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <dependencies>
      <dependency>
        <groupId>org.jetbrains.kotlinx</groupId>
        <artifactId>kotlinx-coroutines-core</artifactId>
      </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-kotlin</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy</artifactId>
    </dependency>
    <dependency>
      <groupId>io.rest-assured</groupId>
      <artifactId>rest-assured</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-smallrye-reactive-messaging-amqp</artifactId>
    </dependency>
    <dependency>
      <groupId>org.liv.services.doom</groupId>
      <artifactId>solver-domain</artifactId>
    </dependency>
  </dependencies>
</project>

The domain pom.xml

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.liv.services.doom</groupId>
  <artifactId>tesa-domain</artifactId>

  <parent>
    <groupId>org.liv.services.doom</groupId>
    <artifactId>tesa-modules</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
</project>

1 Answers1

0

Interesting. It's probably related to the fact that -f is restricting the Maven reactor to the specified module. However, Quarkus bootstrap is doing its own workspace discovery that will find your modules and changes to those modules will be picked up once the dev mode is launched. So, it appears that only the initial launch isn't properly syncing the sources to classes in dependency modules. I suppose you can open an issue for it.

However, assuming only the app module includes the quarkus-maven-plugin, you can simply drop -f and execute quarkus:dev from the root project dir and that should work.

Alexey Loubyansky
  • 308
  • 1
  • 2
  • 8