The code within {{org.hibernate.search.util.common.jar.impl.JarUtils#jarOrDirectoryPath}} only works for “normal” JARs where the classes directory is the root of the JAR (code source location protocol = file).
It will not work for Spring-boot’s [repackaged JARs|https://docs.spring.io/spring-boot/docs/2.2.13.RELEASE/maven-plugin//repackage-mojo.html] in particular, where classes are located in {{/BOOT-INF/classes}} within the JAR, or worse, in a JAR within the JAR (code source location protocol =in {{/BOOT-INF/lib/*. jar}}). Note that in that case, the {{META-INF/jandex.idx}} is still located at the root of the JAR; only classes aren’t.
This makes the feature useless in a Spring Boot applications that rely on repackaged JARs, which I think might be the default in JHipster in particular, and maybe others.
It’s unclear whether this affects other frameworks.
See also:
* [https://stackoverflow.com/questions/74149716/hibernate-search-6-projectionconstructor-not-working/74156021#74156021|https://stackoverflow.com/questions/74149716/hibernate-search-6-projectionconstructor-not-working/74156021#74156021|smart-link] * [https://github.com/anothergoodguy/spring-data-hibernate-search/pull/1|https://github.com/anothergoodguy/spring-data-hibernate-search/pull/1|smart-link] |
|