我在quarkus概念证明中发现JPA实体中的错误。2019-10-24 13:08:09,303 WARN [io.qua.agr.dep.AgroalProcessor] (build-27) Agroal dependency is present but no driver has been defined for the default datasource2019-10-24 13:08:09,515 WARN [io.qua.dep.ste.ReflectiveHierarchyStep] (build-20) Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index: - com.me.quaaaaaaakusone.domain.EmployeeEntity - com.me.quaaaaaaakusone.domain.JobTitleEntityConsider 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.");.我发现了这篇文章: How to create a Jandex index in Quarkus for classes in a external module我按照SOF的回答做了,这也在日志中: 但是我仍然得到上述警告。我真正追求的是:我如何明确告诉quarkus我的JPA实体的位置。我的主要目标是减少启动时间,因此我尝试尽可能避免(过多)扫描。我正在使用Gradle,因此在识别子模块的groupid和artifactid时遇到了麻烦。我找到了这个: https://plugins.gradle.org/plugin/org.galaxx.gradle.jandex但它并没有告诉您如何实现。 与简单的示例相反。我已经对代码进行了分层,并且在:domain子模块中有用于实体的(子)模块。我的文件夹结构如下所示:myRootFolder\apicore\src\main\javamyRootFolder\apicore\src\main\resourcesmyRootFolder\dal\src\main\javamyRootFolder\dal\src\main\resourcesmyRootFolder\domain\src\main\javamyRootFolder\domain\src\main\resourcesmyRootFolder\restlayer\src\main\javamyRootFolder\restlayer\src\main\resources我的settings.gradle看起来像这样:pluginManagement { repositories { mavenLocal() mavenCentral() gradlePluginPortal() } resolutionStrategy { eachPlugin { if (requested.id.id == 'io.quarkus') { useModule("io.quarkus:quarkus-gradle-plugin:${quarkusVersion}") } } }}rootProject.name = 'quaaaaaaakusoneRoot'include 'domain'include 'dal'include 'apicore'include 'restlayer' 最佳答案 将this插件添加到您的域模块的build.gradle中。这将在包含您的域实体的jar内创建jandex索引,然后quarkus在构建镜像时使用它。关于gradle - quarkus,jandex和显式jpa实体,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58546406/ 10-12 19:43