为什么原生的Quarkus可执行文件不启动我的Jax-rs资源与maven多模块结构?

我正在尝试开发一个具有六边形架构的quarkus应用程序。

应用程序代码在 github 中可用。

我有4个模块;业务,持久性,Web服务和应用程序被打包在一个全局模块中,我将在其中生成我的Quarkus应用程序。

当我启动时:

mvn clean package -Pnative

然后是我的原生图像

portfolio-app/target/portfolio-app-1.0-SNAPSHOT-runner

Quarkus无法公开我的PortfolioEndpoint,它不在主模块中。

我可以将我的端点放在我的投资组合应用程序中,这是工作,但我不想破坏六边形架构。

我应该把我所有的Quarkus功能放在同一个maven模块中,还是可以在多个包中拆分功能?


LEATH
浏览 102回答 1
1回答

慕妹3242003

我设法纠正了在我的父pom中添加jandex maven插件的问题,遵循@gsmet&nbsp;<build>&nbsp; &nbsp; <plugins>&nbsp; &nbsp; <plugin>&nbsp; &nbsp; &nbsp; &nbsp; <groupId>org.jboss.jandex</groupId>&nbsp; &nbsp; &nbsp; &nbsp; <artifactId>jandex-maven-plugin</artifactId>&nbsp; &nbsp; &nbsp; &nbsp; <version>1.0.5</version>&nbsp; &nbsp; &nbsp; &nbsp; <executions>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <execution>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <id>make-index</id>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <goals>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <goal>jandex</goal>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </goals>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <!-- phase is 'process-classes by default' -->&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <configuration>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <!-- Nothing needed here for simple cases -->&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </configuration>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </execution>&nbsp; &nbsp; &nbsp; &nbsp; </executions>&nbsp; &nbsp; </plugin>&nbsp; &nbsp; </plugins></build>该插件将生成一个名为jandex.idx的文件,其中包含对目标/类文件夹中包含的所有.class文件的引用。└── target├── classes│&nbsp; &nbsp;├── META-INF│&nbsp; &nbsp;│&nbsp; &nbsp;└── jandex.idx <==== here│&nbsp; &nbsp;└── org│&nbsp; &nbsp; &nbsp; &nbsp;└── acme│&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└── quarkus│&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└── portfolio│&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└── persistence│&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└── repository│&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;├── SqlRepositoryAdapter.class│&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└── SqlRepositoryProvider.class
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java