最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Quarkus custom extension in a multi-module project fails on mvn clean package - Stack Overflow

programmeradmin4浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论