From dcb73d943317f533dc3acdca38fe2b9366640f8b Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Thu, 16 Jan 2025 17:36:09 +0200 Subject: [PATCH] Register `jakarta.validation.ConstraintViolation` unconditionally The class is accessed even when not using hibernate validator. Relates to https://github.com/quarkusio/quarkus/issues/41995 --- .../orm/deployment/HibernateOrmProcessor.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java index 1ecb454e5f2cb..f40a528c1d42f 100644 --- a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java +++ b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java @@ -241,12 +241,12 @@ AdditionalIndexedClassesBuildItem addPersistenceUnitAnnotationToIndex() { @BuildStep public void enrollBeanValidationTypeSafeActivatorForReflection(Capabilities capabilities, BuildProducer reflectiveClasses) { - if (capabilities.isPresent(Capability.HIBERNATE_VALIDATOR)) { - reflectiveClasses.produce(ReflectiveClassBuildItem.builder("org.hibernate.boot.beanvalidation.TypeSafeActivator") - .methods().fields().build()); - reflectiveClasses.produce(ReflectiveClassBuildItem.builder(BeanValidationIntegrator.JAKARTA_BV_CHECK_CLASS) - .constructors(false).build()); - } + // Accessed in org.hibernate.boot.beanvalidation.BeanValidationIntegrator.loadTypeSafeActivatorClass + reflectiveClasses.produce(ReflectiveClassBuildItem.builder("org.hibernate.boot.beanvalidation.TypeSafeActivator") + .methods().fields().build()); + // Accessed in org.hibernate.boot.beanvalidation.BeanValidationIntegrator.isBeanValidationApiAvailable + reflectiveClasses.produce(ReflectiveClassBuildItem.builder(BeanValidationIntegrator.JAKARTA_BV_CHECK_CLASS) + .constructors(false).build()); } @BuildStep