Based on the following maven configuration from this SO question, answered for Maven builds, I need an equivalent bit of code for a Gradle setup. Looking around, I can't find a setup that does this for Gradle.
Synopsis of issue from other question: Essentially that classes from external projects aren't indexed so that Quarkus can use them. The solution below rebuilds the index and allows access to the classes.
Code from other question:
<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>
Also... after more digging, it appears that there might already be a fix in the works here (github merge request. At time of writing, this is merged but doesn't look like it is part of a release. Will follow up if this changes, and if it fixes ths issue.
Update:
With the release of 0.18.0
, I am still having issues, but I believe I am closer. I still get the following (very similar) error:
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.");.
This is with the empty beans.xml
, and at this point I am unsure how to attempt the entries in application.properties.
Entries suggested in other question:
quarkus.index-dependency.<name>.group-id=
quarkus.index-dependency.<name>.artifact-id=
quarkus.index-dependency.<name>.classifier=(this one is optional)
I am confused as for what the placeholder <name>
is supposed to be. Classname? Gradle project name? Also I assume the empty assignments are intentional?
The structure of my overall gradle project:
| Main
| \ (API folder)
| | User API (Quarkus Project, pulls in pojos)
| \ (Common resource folder)
| | Common pojo's (Java library, done with Gradle's plugin)
For the Quarkus devs viewing this, I would argue that this shouldn't be necessary. Sharing pojos between projects is quite common, and what I would call good design. Maybe a quickstart is in order for explaining how to make this work?
beans.xml
or addingquarkus.index-dependency.*
toapplication.properties
). EDIT: it seems I was wrong, there seems to be a Gradle plugin for Jandex here: github.com/galaxx-org/org.galaxx.gradle – Aptitudebeans.xml
or entries inapplication.properties
), hence my continued issues. I have also seen that plugin, but it looks like a dead project, as there haven't been any commits since 2016. Even after trying the galaxx plugin, still hitting the same issue anyways. – Larrup