'How to force modules recompilation in multimodule SpringBoot maven project?

There is a Maven project with two modules with this structure.

project
    moduleA
       pom.xml   // library 

    moduleB
       pom.xml   // SpringBoot application

    pom.xml      // parent aggregator

Module B depends on A.

When executing command mvn spring-boot:run -pl moduleB (from project folder) Maven takes compiled package moduleA.jar from local repository and fails if it is absent there.

Please, help me to find a way of forcing usage of the latest compiled moduleA version every time the moduleB application starts.

In perfect case I would like to avoid mvn install step, just inducing mvn compile (if code changed) or reusing a compiled moduleA; but it also works if somehow application could be started with the latest compiled version of all code in the multimodular project.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source