Add scenario benchmarks comparing BVal and Hibernate Validator ScenarioBenchmark runs each scenario against both providers, selected by a JMH parameter, and checks the expected violation counts once per trial: mixed valid/invalid beans, explicit groups, validateProperty/Value, parameter and return value validation, cascading into large collections and cycles, container element constraints, deep graphs, beans with many built-in constraints (valid and fully invalid), composed and class-level constraints, and EL message expressions. Also run the JMH annotation processor explicitly, as JDK 23+ no longer does so implicitly, and register Tomcat's ExpressionFactory ahead of the bval-jsr test fixture that re-resolves its delegate on every call. Both benchmark classes default to 2 forks of 3 warmup and 5 measurement iterations of 1 s, so that a plain run takes minutes rather than hours.
Apache BVal - Apache's implementation of the Jakarta Validation specification for Jakarta EE and Java SE
Jakarta Validation 4.0 implementation (Jakarta EE 12, WIP), requires Java 17+.
Jakarta Validation 3.1 implementation (Jakarta EE 11), requires Java 17+.
Jakarta Bean Validation 3.0 implementation (Jakarta EE 10), requires Java 11+.
Bean Validation 2.0 (JSR-380) implementation (Java EE 8), requires Java 8+.
Bean Validation 1.1 (JSR-349) implementation (Java EE 7), requires Java 6+.
mvn clean install
<dependency> <groupId>org.apache.bval</groupId> <artifactId>bval-jsr</artifactId> <version>${bval.version}</version> </dependency>
<dependency> <groupId>org.apache.bval</groupId> <artifactId>bval-extras</artifactId> <version>${bval.version}</version> </dependency>
<dependency> <groupId>org.apache.bval</groupId> <artifactId>org.apache.bval.bundle</artifactId> <version>${bval.version}</version> </dependency>
ValidatorFactory validatorFactory = Validation .byProvider(ApacheValidationProvider.class) .configure() .buildValidatorFactory(); Validator validator = validatorFactory.getValidator(); Set<ConstraintViolation<MyBean>> violations = validator.validate(myBean);
Please visit https://bval.apache.org for full documentation and release notes.
Issue tracker: https://issues.apache.org/jira/browse/BVAL