基于以下来自this SO question, answered for Maven builds的maven配置,我需要一段用于Gradle设置的等效代码。环顾四周,我找不到一个为Gradle做这件事的设置。
来自其他问题的问题摘要:本质上,来自外部项目的类不会被索引,以便Quarkus可以使用它们。下面的解决方案重建索引并允许访问类。
来自其他问题的代码:
<build>
<plugins>
<plugin>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version>1.0.6</version>
<executions>
<execution>
<id>make-index</id>
<goals>
<goal>jandex</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>还有..。经过进一步的挖掘,似乎在works here (github merge request中已经有了修复。在撰写本文时,这是合并的,但看起来不像是发行版的一部分。如果这一点改变了,如果它解决了这个问题,我会跟进的。
更新:
随着0.18.0的发布,我仍然有问题,但我相信我更接近了。我仍然得到以下(非常相似的)错误:
2019-06-27 19:45:52,741 INFO [io.qua.dep.QuarkusAugmentor] (main) Beginning quarkus augmentation
2019-06-27 19:45:53,241 WARN [io.qua.dep.ste.ReflectiveHierarchyStep] (build-8) Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index:
- com.ebp.reasonadle.shared.pojos.user.User
Consider adding them to the index either by creating a Jandex index for your dependency via the Maven plugin, an empty META-INF/beans.xml or quarkus.index-dependency properties.");.这是使用空的beans.xml,此时我不确定如何尝试在application.properties中输入。
其他问题中建议的条目:
quarkus.index-dependency.<name>.group-id=
quarkus.index-dependency.<name>.artifact-id=
quarkus.index-dependency.<name>.classifier=(this one is optional)我对占位符<name>应该是什么感到困惑。类名?Gradle项目名称?我还假设空的赋值是故意的?
我整个gradle项目的结构:
| Main
| \ (API folder)
| | User API (Quarkus Project, pulls in pojos)
| \ (Common resource folder)
| | Common pojo's (Java library, done with Gradle's plugin)对于查看此内容的Quarkus开发人员,我认为这不应该是必要的。在项目之间共享pojos是很常见的,我称之为好的设计。也许快速入门是为了解释如何让它工作?
发布于 2020-07-15 00:47:12
这个问题最终被https://github.com/quarkusio/quarkus/issues/6635解决了
1.5.0复发了,但很快就解决了。
对我来说,似乎不需要META-INF文件夹中的任何额外内容,也不需要对其他子模块进行手动/显式索引。
https://stackoverflow.com/questions/56781972
复制相似问题