quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.36k stars 2.56k forks source link

Jandex warning when using @RegisterForReflection(registerFullHierarchy = true) #38486

Open manofthepeace opened 5 months ago

manofthepeace commented 5 months ago

Describe the bug

When using @RegisterForReflection(registerFullHierarchy = true) on a class. The following warning appears while building;

[INFO] --- quarkus:3.6.1:build (default) @ reflect-jandex ---
[WARNING] [io.quarkus.deployment.steps.ReflectiveHierarchyStep] Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index:
    - org.acme.SubEntity (source: <unknown>)
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.

To remove the warning @RegisterForReflection can manually be used for all classes individually. End result is the same in the native build

The interesting thing is that despite the warning saying it is unable to register the full hierarchy the annotation it is still doing what it should do. i.e. the full hierarchy is registered for reflection and native build does work. So the warning seems misleading in that sense as well.

Expected behavior

No warning is shown

Actual behavior

warning is shown

How to Reproduce?

Reproducer: https://github.com/manofthepeace/quarkus-jandex-issue

Steps to reproduce; 1- run mvn clean package and watch the output

Output of uname -a or ver

Darwin Kernel Version 21.6.0

Output of java -version

OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode)

Quarkus version or git rev

3.6.X

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)

Additional information

No response

quarkus-bot[bot] commented 5 months ago

/cc @Karm (mandrel), @galderz (mandrel), @zakkak (mandrel,native-image)

gsmet commented 5 months ago

This is annoying. Thanks for the report, I will have a look soon.

ls-bit commented 4 days ago

We are also seeing this issue in 3.8.5 and it produces a lot of unnecessary logs in our builds. Would be great if it gets fixed