-
|
To prevent an "XY problem", first some context: In our project, we have the need for an annotation similar to So far, we have implemented this as a So now a question: is there a way to determine reliably, either through class loaders or through Jandex (or something else), whether a given class will be available at runtime? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
You might be able to use Some other thoughts: All of the artifacts which are known to the build process (more or less) can be found in the application model, which can be found as part of the I believe that the Jandex index only contains artifacts which have been identified as needing indexing, for example if there is a |
Beta Was this translation helpful? Give feedback.
You might be able to use
io.quarkus.bootstrap.classloading.QuarkusClassLoader#isClassPresentAtRuntime(String)for this purpose.Some other thoughts:
All of the artifacts which are known to the build process (more or less) can be found in the application model, which can be found as part of the
CurateOutcomeBuildItemfrom an extension build step. You can examine the flags of each dependency to know if it will be included (DependencyFlags.RUNTIME_CPis likely what you want). This is a list of artifacts and is not indexed.I believe that the Jandex index only contains artifacts which have been identified as needing indexing, for example if there is a
META-INF/beans.xmlfile present in the ar…