diff --git a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java index a775f820..de53224f 100644 --- a/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java +++ b/commons/deployment/src/main/java/com/github/mcollovati/quarkus/hilla/deployment/QuarkusHillaNativeProcessor.java @@ -225,16 +225,6 @@ void hillaNativeSupport( .includePatterns("META-INF/microprofile-config\\.properties") .build()); - // explicitly register classes not present in the index - reflectiveClass.produce(ReflectiveClassBuildItem.builder( - com.github.mcollovati.quarkus.hilla.crud.panache.CrudRepositoryService.class, - com.github.mcollovati.quarkus.hilla.crud.panache.ListRepositoryService.class, - com.github.mcollovati.quarkus.hilla.crud.spring.CrudRepositoryService.class, - com.github.mcollovati.quarkus.hilla.crud.spring.ListRepositoryService.class) - .constructors() - .methods() - .build()); - IndexView index = combinedIndex.getComputingIndex(); Set classes = new HashSet<>(); classes.addAll(index.getAllKnownImplementors(EndpointTransferMapper.Mapper.class)); @@ -254,6 +244,23 @@ void hillaNativeSupport( classes.add(index.getClassByName("org.springframework.data.repository.CrudRepository")); classes.add(index.getClassByName("org.springframework.data.domain.Pageable")); classes.add(index.getClassByName("org.springframework.data.domain.Specification")); + + // explicitly register classes not present in the index + reflectiveClass.produce(ReflectiveClassBuildItem.builder( + com.github.mcollovati.quarkus.hilla.crud.spring.CrudRepositoryService.class, + com.github.mcollovati.quarkus.hilla.crud.spring.ListRepositoryService.class) + .constructors() + .methods() + .build()); + } + + if (capabilities.isPresent(QuarkusHillaExtensionProcessor.PANACHE_SUPPORT)) { + reflectiveClass.produce(ReflectiveClassBuildItem.builder( + com.github.mcollovati.quarkus.hilla.crud.panache.CrudRepositoryService.class, + com.github.mcollovati.quarkus.hilla.crud.panache.ListRepositoryService.class) + .constructors() + .methods() + .build()); } reflectiveClass.produce(ReflectiveClassBuildItem.builder(classes.stream()