为什么本机 Quarkus 可执行文件不使用 maven 多模块结构启动我的 Jax-rs 资源?
Why native Quarkus executable does not launch my Jax-rs resources with maven multimodule structure?
我正在尝试开发具有六边形架构的 quarkus 应用程序。
应用程序代码在 github 中可用。
我有4个模块;业务、持久性、Web 服务和应用程序打包在一个全局模块中,我将在其中生成我的 Quarkus 应用程序。
当我启动时:
mvn clean package -Pnative
然后是我的原始图像
portfolio-app/target/portfolio-app-1.0-SNAPSHOT-runner
Quarkus 无法公开不在主模块中的我的 PortfolioEndpoint。
我可以将我的端点放在我的投资组合应用程序中并且它可以工作,但我不想破坏六边形架构。
我应该将我所有的 Quarkus 功能放在同一个 Maven 模块中,还是可以将功能拆分到多个包中?
我按照@gsmet
的建议设法纠正了在我的父 pom 中添加 jandex maven plugin 的问题
<build>
<plugins>
<plugin>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version>1.0.5</version>
<executions>
<execution>
<id>make-index</id>
<goals>
<goal>jandex</goal>
</goals>
<!-- phase is 'process-classes by default' -->
<configuration>
<!-- Nothing needed here for simple cases -->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
该插件将生成一个名为 jandex.idx 的文件,其中包含对 target/classes 文件夹中包含的所有 .class 文件的引用。
└── target
├── classes
│ ├── META-INF
│ │ └── jandex.idx <==== here
│ └── org
│ └── acme
│ └── quarkus
│ └── portfolio
│ └── persistence
│ └── repository
│ ├── SqlRepositoryAdapter.class
│ └── SqlRepositoryProvider.class
我正在尝试开发具有六边形架构的 quarkus 应用程序。
应用程序代码在 github 中可用。
我有4个模块;业务、持久性、Web 服务和应用程序打包在一个全局模块中,我将在其中生成我的 Quarkus 应用程序。
当我启动时:
mvn clean package -Pnative
然后是我的原始图像
portfolio-app/target/portfolio-app-1.0-SNAPSHOT-runner
Quarkus 无法公开不在主模块中的我的 PortfolioEndpoint。
我可以将我的端点放在我的投资组合应用程序中并且它可以工作,但我不想破坏六边形架构。
我应该将我所有的 Quarkus 功能放在同一个 Maven 模块中,还是可以将功能拆分到多个包中?
我按照@gsmet
的建议设法纠正了在我的父 pom 中添加 jandex maven plugin 的问题 <build>
<plugins>
<plugin>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version>1.0.5</version>
<executions>
<execution>
<id>make-index</id>
<goals>
<goal>jandex</goal>
</goals>
<!-- phase is 'process-classes by default' -->
<configuration>
<!-- Nothing needed here for simple cases -->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
该插件将生成一个名为 jandex.idx 的文件,其中包含对 target/classes 文件夹中包含的所有 .class 文件的引用。
└── target
├── classes
│ ├── META-INF
│ │ └── jandex.idx <==== here
│ └── org
│ └── acme
│ └── quarkus
│ └── portfolio
│ └── persistence
│ └── repository
│ ├── SqlRepositoryAdapter.class
│ └── SqlRepositoryProvider.class