根据这个 SO question 中的以下 maven 配置,已回答 Maven builds,我需要一段等效的代码来进行 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>
另外......经过更多挖掘,似乎这里可能已经有一个修复(github合并请求。在撰写本文时,它已合并但看起来不像是发布的一部分。将跟进如果这种情况发生变化,并且它是否解决了这个问题。
更新:
随着 的发布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 开发人员,我认为这不应该是必要的。在项目之间共享 pojo 是很常见的,我称之为好的设计。也许快速入门是为了解释如何使这项工作?