smallrye / jandex

Java Annotation Indexer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support scanning of selected packages, classes in other dependencies

tjquinno opened this issue · comments

Inspired by the movement on #138...

The plug-in supports scanning .class files.

Has there ever been thought to including .class entries in other dependency JARs?

In this Helidon issue helidon-io/helidon#2729 referenced from #138, the use case is this: The application currently being built by maven (and for which the Jandex plug-in is executed) contains endpoints with MicroProfile OpenAPI annotations. Those endpoints happen to refer to POJO business classes defined in other dependencies which might or might not also bear OpenAPI annotations.

It would be great to have a way to create a single Jandex index (from one execution of the plug-in) that included not only information about the current project's classes but also selected classes from other dependencies, JARs which do not have their own Jandex indices.

Of course, one would want a way to identify which dependencies, which classes or packages within them, etc. to include in the scan.

A workaround, also mentioned in the Helidon issue, would be to extract the contents of selected other dependencies into temp directories and point fileset configuration to the extracted contents. For the developer, though, it'd be simpler to be able to tell just the Jandex plug-in about those other dependencies and the relevant selection of packages/classes, rather than involve other plug-ins to extract their contents to disk first.

Yea I think that makes sense.

Done in #196.