So I have a Multi-Module Maven structure that looks like this:
├── lib-module
│ ├── pom.xml
├── extensions-bundle (extensions parent)
│ ├── pom.xml
│ └── extension-a (a module from the extensions parent)
│ ├── deployment (a module from extension-a)
| ├── runtime (a module from extension-a)
│ └── pom.xml
├── module-a
│ ├── pom.xml
│ └── src
│ ├── main
│ └── test
└── pom.xml (root)
module-a
depends on the runtime
module of the extension-a
.
runtime
module from the extension-a
depends on the lib-module
.
deployment
module from the extension-a
depends on the runtime
module from the extension-a
The root pom has the following modules:
<modules>
<module>module-a</module>
<module>lib-module</module>
<module>extensions-bundle</module>
</modules>
When I do
$ cd module-a
$ mvn clean quarkus:dev
It works flawlessly.
But when I run from the root
$ mvn clean package
The build of the module-a
fails because seems like Maven didn't found the extension deployment jar file.
When inspecting Maven output, I saw that it tries to download the jar from the deployment
extension module.
[INFO] --- quarkus:3.17.7:generate-code (default) @ extension-a-deployment ---
Downloading from central: .0/extension-a-deployment-1.0.jar
The following happens:
[INFO] root ............................... SUCCESS [ 0.090 s]
[INFO] lib-a .............................. SUCCESS [ 1.529 s]
[INFO] extensions-bundle .................. SUCCESS [ 0.006 s]
[INFO] extension-a-parent ................. SUCCESS [ 0.004 s]
[INFO] extension-a-runtime ................ SUCCESS [ 0.891 s]
[INFO] module-a ........................... FAILURE [ 0.075 s]
[INFO] extension-a-deployment ............. SKIPPED
and the build fails with the following error:
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.17.7:generate-code (default) on project extension-a-deployment: Quarkus code generation phase has failed: Failed to bootstrap application in NORMAL mode: Failed to resolve artifact io.matheus:extension-a-deployment:jar:1.0: The following artifacts could not be resolved: io.matheus:extension-a-deployment:jar:1.0 (absent): Could not find artifact io.matheus:extension-a-deployment:jar:1.0 in central () -> [Help 1]
Any idea on how to fix this?