diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f30b4bdd87..488c6f94d1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Guidelines for contributing to Hibernate Validator Contributions from the community are essential in keeping Hibernate Validator strong and successful. This guide focuses on how to contribute back to Hibernate Validator using GitHub pull requests. If you need help with cloning, compiling or setting the project up in an IDE please refer to -[this page](http://hibernate.org/validator/contribute/). +[this page](https://hibernate.org/validator/contribute/). ## Legal diff --git a/README.md b/README.md index cf837205b4..e474ff0887 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ the metadata through the use of XML validation descriptors. ## Documentation -The documentation for this release is included in the _docs_ directory of the distribution package or can be accessed [online](http://hibernate.org/validator/documentation/). +The documentation for this release is included in the _docs_ directory of the distribution package or can be accessed [online](https://hibernate.org/validator/documentation/). ## Release Notes @@ -76,7 +76,7 @@ You will also need a JDK 17+ and Maven 3 (>= 3.9.8). With these prerequisites in mvn clean install -There are more build options available as well. For more information refer to [Contributing to Hibernate Validator](http://hibernate.org/validator/contribute/). +There are more build options available as well. For more information refer to [Contributing to Hibernate Validator](https://hibernate.org/validator/contribute/). ## Continuous Integration @@ -88,10 +88,10 @@ This build runs on Linux and Windows and executes the TCK both in standalone and ## Hibernate Validator URLs -* [Home Page](http://hibernate.org/validator/) -* [Jakarta Validation Home](http://beanvalidation.org/) +* [Home Page](https://hibernate.org/validator/) +* [Jakarta Validation Home](https://beanvalidation.org/) * [Jakarta Validation Specs](https://jakarta.ee/specifications/bean-validation/) -* [Downloads](http://hibernate.org/validator/downloads/) -* [Mailing Lists](http://hibernate.org/community/) +* [Downloads](https://hibernate.org/validator/downloads/) +* [Mailing Lists](https://hibernate.org/community/) * [Issue Tracking](https://hibernate.atlassian.net/browse/HV) * [Continuous Integration](http://ci.hibernate.org/view/Validator/) diff --git a/documentation/pom.xml b/documentation/pom.xml index b8bdfcf0dc..1997569bf0 100644 --- a/documentation/pom.xml +++ b/documentation/pom.xml @@ -28,7 +28,6 @@ ${basedir}/src/test/java ${basedir}/src/test/resources ${basedir}/../engine/src/main/java - ${basedir}/../osgi/integrationtest/src/test/java validator G-282CVRCQHZ @@ -59,6 +58,11 @@ hibernate-validator-cdi test + + ${project.groupId} + hibernate-validator-test-utils + test + jakarta.enterprise jakarta.enterprise.cdi-api @@ -79,11 +83,6 @@ groovy-jsr223 test - - org.osgi - org.osgi.core - test - org.springframework spring-expression @@ -285,7 +284,6 @@ ${asciidoctor.examples-source-dir} ${asciidoctor.examples-resources-dir} ${asciidoctor.engine-source-dir} - ${asciidoctor.osgi-integrationtest-source-dir} ${project.version} ${version.jakarta.validation-api} diff --git a/documentation/src/main/asciidoc/ch09.asciidoc b/documentation/src/main/asciidoc/ch09.asciidoc index 8861e53530..6d56026996 100644 --- a/documentation/src/main/asciidoc/ch09.asciidoc +++ b/documentation/src/main/asciidoc/ch09.asciidoc @@ -82,8 +82,7 @@ its `ValidationProvider` implementation. In the case of Hibernate Validator, thi Depending on your environment and its classloading specifics, provider discovery via the Java's service loader mechanism might not work. In this case, you can plug in a custom -`ValidationProviderResolver` implementation which performs the provider retrieval. An example is OSGi, -where you could implement a provider resolver which uses OSGi services for provider discovery. +`ValidationProviderResolver` implementation which performs the provider retrieval. To use a custom provider resolver, pass it via `providerResolver()` as shown in <>. @@ -93,7 +92,7 @@ To use a custom provider resolver, pass it via `providerResolver()` as shown in ==== [source, JAVA, indent=0] ---- -include::{sourcedir}/org/hibernate/validator/referenceguide/chapter09/OsgiServiceDiscoverer.java[tags=include] +include::{sourcedir}/org/hibernate/validator/referenceguide/chapter09/CustomValidationProviderResolver.java[tags=include] ---- [source, JAVA, indent=0] @@ -436,7 +435,7 @@ For constraints like `@ScriptAssert` and `@ParameterScriptAssert`, it might be u how the script engines are initialized and how the script evaluators are built. This can be done by setting a custom implementation of `ScriptEvaluatorFactory`. -In particular, this is important for modular environments (e.g. OSGi), where user might face issues +In particular, this is important for modular environments, where user might face issues with modular class loading and https://www.jcp.org/en/jsr/detail?id=223[JSR 223]. It also allows to use any custom script engine, not necessarily based on the https://www.jcp.org/en/jsr/detail?id=223[JSR 223] (e.g. Spring Expression Language). @@ -487,7 +486,7 @@ To solve this issue, the `MultiClassLoaderScriptEvaluatorFactory` class below ca ==== [source, JAVA, indent=0] ---- -include::{osgi-integrationtest-sourcedir}/org/hibernate/validator/osgi/scripting/MultiClassLoaderScriptEvaluatorFactory.java[] +include::{sourcedir}/org/hibernate/validator/referenceguide/chapter09/MultiClassLoaderScriptEvaluatorFactory.java[] ---- ==== @@ -496,33 +495,12 @@ and then declared with: ==== [source, JAVA, indent=0] ---- -include::{osgi-integrationtest-sourcedir}/org/hibernate/validator/osgi/integrationtest/OsgiIntegrationTest.java[tags=scriptEvaluatorFactoryMultiClassLoaderScriptEvaluatorFactory] +include::{sourcedir}/org/hibernate/validator/referenceguide/chapter09/BootstrappingTest.java[tags=scriptEvaluatorFactoryMultiClassLoaderScriptEvaluatorFactory] ---- ==== This way, it is possible to pass multiple `ClassLoader` instances: typically the class loaders of the wanted ``ScriptEngine``s. -An alternative approach for OSGi environments can be to use the `OsgiScriptEvaluatorFactory` defined below: - -==== -[source, JAVA, indent=0] ----- -include::{osgi-integrationtest-sourcedir}/org/hibernate/validator/osgi/scripting/OsgiScriptEvaluatorFactory.java[] ----- -==== - -and then declared with: - -==== -[source, JAVA, indent=0] ----- -include::{osgi-integrationtest-sourcedir}/org/hibernate/validator/osgi/integrationtest/OsgiIntegrationTest.java[tags=scriptEvaluatorFactoryOsgiScriptEvaluatorFactory] ----- -==== - -It is designed specifically for OSGi environments and allows you to pass the `BundleContext` which will be used to search -for `ScriptEngineFactory` as a parameter. - As already mentioned, you can also use script engines that are not based on https://www.jcp.org/en/jsr/detail?id=223[JSR 223]. For instance, to use the https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#expressions[Spring Expression Language], diff --git a/documentation/src/main/asciidoc/ch11.asciidoc b/documentation/src/main/asciidoc/ch11.asciidoc index edf379e511..a765e4d5b3 100644 --- a/documentation/src/main/asciidoc/ch11.asciidoc +++ b/documentation/src/main/asciidoc/ch11.asciidoc @@ -384,3 +384,11 @@ dependency injection in constraint validators. Hibernate Validator also provides support for the unwrapping of JavaFX properties. If JavaFX is present on the classpath, ``ValueExtractor``s for JavaFX properties are automatically registered. See <> for examples and further discussion. + + +[[validator-osgi]] +=== OSGi + +Starting with Hibernate Validator 9.0, the Hibernate team no longer tests nor maintains the OSGi integration. +For users who would want to experiment with Hibernate Validator in an OSGi environment, +we will keep the existing manifest entries in place as they were. diff --git a/documentation/src/main/asciidoc/ch12.asciidoc b/documentation/src/main/asciidoc/ch12.asciidoc index a8ef2c3fb1..d6141bdaf4 100644 --- a/documentation/src/main/asciidoc/ch12.asciidoc +++ b/documentation/src/main/asciidoc/ch12.asciidoc @@ -803,6 +803,8 @@ There are several cases in which Hibernate Validator needs to load resources or By default, Hibernate Validator tries to load these resources via the current thread context class loader. If that's not successful, Hibernate Validator's own class loader will be tried as a fallback. +// Let's keep this mention of OSGi here in the docs, pointing the users, +// to what they can do, if they are in the OSGi env. For cases where this strategy is not appropriate (e.g. modularized environments such as OSGi), you may provide a specific class loader for loading these resources when bootstrapping the validator factory: diff --git a/documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/BootstrappingTest.java b/documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/BootstrappingTest.java index c61dc6b05f..9dbc638a2e 100644 --- a/documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/BootstrappingTest.java +++ b/documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/BootstrappingTest.java @@ -1,7 +1,12 @@ package org.hibernate.validator.referenceguide.chapter09; +import static org.hibernate.validator.testutil.ConstraintViolationAssert.assertThat; +import static org.hibernate.validator.testutil.ConstraintViolationAssert.pathWith; +import static org.hibernate.validator.testutil.ConstraintViolationAssert.violationOf; + import java.io.InputStream; import java.time.Duration; +import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; @@ -11,9 +16,12 @@ import org.hibernate.validator.HibernateValidator; import org.hibernate.validator.cfg.ConstraintMapping; +import org.hibernate.validator.constraints.ScriptAssert; import org.junit.Test; +import org.codehaus.groovy.jsr223.GroovyScriptEngineFactory; + public class BootstrappingTest { @Test @@ -54,7 +62,7 @@ public void byDefaultProvider() { public void providerResolver() { //tag::providerResolver[] ValidatorFactory validatorFactory = Validation.byDefaultProvider() - .providerResolver( new OsgiServiceDiscoverer() ) + .providerResolver( new CustomValidationProviderResolver() ) .configure() .buildValidatorFactory(); Validator validator = validatorFactory.getValidator(); @@ -227,4 +235,41 @@ public void scriptEvaluatorFactoryProgrammatically() { Validator validator = validatorFactory.getValidator(); //end::scriptEvaluatorFactoryProgrammatically[] } + + @Test + public void canUseScriptAssertConstraintWithMultiClassLoaderScriptEvaluatorFactory() { + //tag::scriptEvaluatorFactoryMultiClassLoaderScriptEvaluatorFactory[] + Validator validator = Validation.byProvider( HibernateValidator.class ) + .configure() + .scriptEvaluatorFactory( + new MultiClassLoaderScriptEvaluatorFactory( GroovyScriptEngineFactory.class.getClassLoader() ) + ) + .buildValidatorFactory() + .getValidator(); + //end::scriptEvaluatorFactoryMultiClassLoaderScriptEvaluatorFactory[] + + canUseScriptAssertConstraint( validator ); + } + + private void canUseScriptAssertConstraint(Validator validator) { + assertThat( + validator.validate( new Event( LocalDate.of( 2017, 8, 8 ), LocalDate.of( 2016, 8, 8 ) ) ) + ).containsOnlyViolations( + violationOf( ScriptAssert.class ).withPropertyPath( pathWith().bean() ) + .withMessage( "start of event cannot be after the end" ) + ); + } + + @ScriptAssert(lang = "groovy", script = "_this.start < _this.end", message = "start of event cannot be after the end") + public class Event { + + private final LocalDate start; + + private final LocalDate end; + + public Event(LocalDate start, LocalDate end) { + this.start = start; + this.end = end; + } + } } diff --git a/documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/OsgiServiceDiscoverer.java b/documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/CustomValidationProviderResolver.java similarity index 64% rename from documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/OsgiServiceDiscoverer.java rename to documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/CustomValidationProviderResolver.java index 543709876e..e6655defa9 100644 --- a/documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/OsgiServiceDiscoverer.java +++ b/documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/CustomValidationProviderResolver.java @@ -8,12 +8,15 @@ import jakarta.validation.spi.ValidationProvider; //tag::include[] -public class OsgiServiceDiscoverer implements ValidationProviderResolver { +public class CustomValidationProviderResolver implements ValidationProviderResolver { @Override public List> getValidationProviders() { //... - return null; + //end::include[] + List> providers = null; + //tag::include[] + return providers; } } //end::include[] diff --git a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/scripting/MultiClassLoaderScriptEvaluatorFactory.java b/documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/MultiClassLoaderScriptEvaluatorFactory.java similarity index 96% rename from osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/scripting/MultiClassLoaderScriptEvaluatorFactory.java rename to documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/MultiClassLoaderScriptEvaluatorFactory.java index 44fb24d01f..2468f43f7e 100644 --- a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/scripting/MultiClassLoaderScriptEvaluatorFactory.java +++ b/documentation/src/test/java/org/hibernate/validator/referenceguide/chapter09/MultiClassLoaderScriptEvaluatorFactory.java @@ -4,7 +4,7 @@ * License: Apache License, Version 2.0 * See the license.txt file in the root directory or . */ -package org.hibernate.validator.osgi.scripting; +package org.hibernate.validator.referenceguide.chapter09; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; diff --git a/engine/pom.xml b/engine/pom.xml index 757fb2d0d7..8d22796cb9 100644 --- a/engine/pom.xml +++ b/engine/pom.xml @@ -42,7 +42,7 @@ site - http://hibernate.org/validator + https://hibernate.org/validator diff --git a/osgi/felixtest/pom.xml b/osgi/felixtest/pom.xml deleted file mode 100644 index 704f4c5f58..0000000000 --- a/osgi/felixtest/pom.xml +++ /dev/null @@ -1,207 +0,0 @@ - - - 4.0.0 - - - org.hibernate.validator - hibernate-validator-osgi - 8.0.0-SNAPSHOT - - - hibernate-validator-osgi-felixtest - - Hibernate Validator OSGi integration test for Felix - Hibernate Validator OSGi integration test for Felix using Payara Server - - - ../.. - - - true - - - - - - org.jboss.arquillian - arquillian-bom - ${version.org.jboss.arquillian} - import - pom - - - - - - - org.hibernate.validator - hibernate-validator - provided - - - org.hibernate.validator - hibernate-validator-cdi - provided - - - - jakarta.validation - jakarta.validation-api - provided - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - org.testng - testng - test - - - org.jboss.arquillian.testng - arquillian-testng-container - test - - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-api-maven - test - - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven - test - - - org.jboss.arquillian.protocol - arquillian-protocol-servlet - test - - - fish.payara.arquillian - arquillian-payara-server-managed - ${version.fish.payara.arquillian} - test - - - - javax.inject - javax.inject - - - - - - - true - src/test/resources - - - - - maven-checkstyle-plugin - - - de.thetaphi - forbiddenapis - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - maven-gpg-plugin - - true - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - felix-integration-test - - integration-test - verify - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - pre-integration-test - - unpack - - - - - fish.payara.distributions - payara - ${version.fish.payara} - zip - false - ${project.build.directory} - - - - - - copy-hibernate-validator-jars-to-payara - pre-integration-test - - copy - - - - - org.hibernate.validator - hibernate-validator - ${project.version} - jar - ${project.build.directory}/payara5/glassfish/modules - hibernate-validator.jar - true - - - org.hibernate.validator - hibernate-validator-cdi - ${project.version} - jar - ${project.build.directory}/payara5/glassfish/modules - hibernate-validator-cdi.jar - true - - - jakarta.validation - jakarta.validation-api - ${bv.api.version} - jar - ${project.build.directory}/payara5/glassfish/modules - validation-api.jar - true - - - - - - - - - diff --git a/osgi/felixtest/src/test/java/com/example/cdi/MyBean.java b/osgi/felixtest/src/test/java/com/example/cdi/MyBean.java deleted file mode 100644 index a074f667ff..0000000000 --- a/osgi/felixtest/src/test/java/com/example/cdi/MyBean.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example.cdi; - -import jakarta.enterprise.context.RequestScoped; - -@RequestScoped -public class MyBean { - - public void doDefault(@ValidNumber String number) { - } - - public void doAll9(@ValidNumber("all9") String number) { - } -} diff --git a/osgi/felixtest/src/test/java/com/example/cdi/ValidNumber.java b/osgi/felixtest/src/test/java/com/example/cdi/ValidNumber.java deleted file mode 100644 index 699f04b03c..0000000000 --- a/osgi/felixtest/src/test/java/com/example/cdi/ValidNumber.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example.cdi; - -import static java.lang.annotation.ElementType.ANNOTATION_TYPE; -import static java.lang.annotation.ElementType.CONSTRUCTOR; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.validation.Constraint; -import jakarta.validation.Payload; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Pattern; -import jakarta.validation.constraints.Size; - -@Documented -@Target({ ANNOTATION_TYPE, METHOD, FIELD, CONSTRUCTOR, PARAMETER }) -@Retention(RUNTIME) -@Constraint(validatedBy = ValidNumberValidator.class) -@Size(min = 3, message = "Must be 3 at least") -@Pattern(regexp = "[0-9]*") -@NotNull(message = "Cannot be null") -public @interface ValidNumber { - - String message() default "invalid number"; - - Class[] groups() default {}; - - Class[] payload() default {}; - - String value() default ""; -} diff --git a/osgi/felixtest/src/test/java/com/example/cdi/ValidNumberValidator.java b/osgi/felixtest/src/test/java/com/example/cdi/ValidNumberValidator.java deleted file mode 100644 index aeae8ef37f..0000000000 --- a/osgi/felixtest/src/test/java/com/example/cdi/ValidNumberValidator.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example.cdi; - -import jakarta.validation.ConstraintValidator; -import jakarta.validation.ConstraintValidatorContext; - -public class ValidNumberValidator implements ConstraintValidator { - - private ValidNumber validNumber; - - @Override - public void initialize(ValidNumber validNumber) { - this.validNumber = validNumber; - } - - @Override - public boolean isValid(String value, ConstraintValidatorContext context) { - if ( "all9".equals( validNumber.value() ) ) { - return value.chars().allMatch( c -> c == '9' ); - } - - return true; - } -} diff --git a/osgi/felixtest/src/test/java/org/hibernate/validator/osgi/felix/FelixCDIIT.java b/osgi/felixtest/src/test/java/org/hibernate/validator/osgi/felix/FelixCDIIT.java deleted file mode 100644 index f0a41b6331..0000000000 --- a/osgi/felixtest/src/test/java/org/hibernate/validator/osgi/felix/FelixCDIIT.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package org.hibernate.validator.osgi.felix; - -import static org.jboss.shrinkwrap.api.ShrinkWrap.create; - -import javax.inject.Inject; - -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.testng.Arquillian; -import org.jboss.shrinkwrap.api.Archive; -import org.jboss.shrinkwrap.api.spec.WebArchive; -import org.jboss.shrinkwrap.resolver.api.maven.Maven; -import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage; -import org.testng.annotations.Test; - -import com.example.cdi.MyBean; -import com.example.cdi.ValidNumber; -import com.example.cdi.ValidNumberValidator; - -public class FelixCDIIT extends Arquillian { - - @Inject - private MyBean bean; - - @Deployment - public static Archive deployment() { - PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile( "pom.xml" ); - WebArchive war = create( WebArchive.class ) - .addClasses( - MyBean.class, - ValidNumber.class, - ValidNumberValidator.class ) - .addAsLibraries( pom.resolve( "org.testng:testng" ).withTransitivity().asFile() ); - - return war; - } - - @Test - public void testDefault() { - bean.doDefault( "123456" ); - } - - @Test - public void testAll9Valid() { - bean.doAll9( "99999" ); - } - - @Test(expectedExceptions = Exception.class, expectedExceptionsMessageRegExp = "(?s).*invalid number.*(?s)") - public void testAll9Invalid() { - bean.doAll9( "999949" ); - } -} diff --git a/osgi/felixtest/src/test/resources/arquillian.xml b/osgi/felixtest/src/test/resources/arquillian.xml deleted file mode 100644 index b2294cc723..0000000000 --- a/osgi/felixtest/src/test/resources/arquillian.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - ${basedir}/target/payara5 - - - - - - diff --git a/osgi/integrationtest/pom.xml b/osgi/integrationtest/pom.xml deleted file mode 100644 index d4a891c34f..0000000000 --- a/osgi/integrationtest/pom.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - 4.0.0 - - - org.hibernate.validator - hibernate-validator-osgi - 8.0.0-SNAPSHOT - - - hibernate-validator-osgi-integrationtest - jar - - Hibernate Validator OSGi integration test - Hibernate Validator OSGi integration test using Apache Karaf - - - true - true - - forbidden-allow-junit.txt - ../.. - - - - - - jakarta.validation - jakarta.validation-api - test - - - ${project.groupId} - hibernate-validator - test - - - ${project.groupId} - hibernate-validator-osgi-karaf-features - ${project.version} - pom - test - - - jakarta.inject - jakarta.inject-api - test - - - - - javax.money - money-api - test - - - org.javamoney - moneta - test - - - javax.annotation - javax.annotation-api - - - - - - jakarta.annotation - jakarta.annotation-api - test - - - - javax.inject - javax.inject - - - - - org.apache.groovy - groovy-jsr223 - test - - - - - org.ops4j.pax.exam - pax-exam-container-karaf - ${version.org.ops4j.pax.exam} - test - - - org.apache.karaf - apache-karaf - ${version.org.apache.karaf} - tar.gz - test - - - - * - * - - - - - org.apache.karaf.features - org.apache.karaf.features.core - ${version.org.apache.karaf} - test - - - org.ops4j.pax.exam - pax-exam-junit4 - ${version.org.ops4j.pax.exam} - test - - - org.ops4j.pax.exam - pax-exam - ${version.org.ops4j.pax.exam} - test - - - org.ops4j.pax.url - pax-url-aether - ${version.org.ops4j.pax.url} - test - - - org.osgi - org.osgi.core - ${version.org.osgi.core} - test - - - - junit - junit - test - - - org.slf4j - slf4j-api - test - - - org.apache.logging.log4j - log4j-slf4j-impl - test - - - org.glassfish.expressly - expressly - test - - - - - - - - org.apache.servicemix.tooling - depends-maven-plugin - - - generate-depends-file - - generate-depends-file - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - false - - ${settings.localRepository} - ${mavencentral.repo.url} - - - - - maven-checkstyle-plugin - - - de.thetaphi - forbiddenapis - - - - - diff --git a/osgi/integrationtest/src/test/java/com/example/Customer.java b/osgi/integrationtest/src/test/java/com/example/Customer.java deleted file mode 100644 index bfa7fc4b8d..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/Customer.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example; - -import jakarta.validation.constraints.DecimalMin; -import jakarta.validation.constraints.Min; - -/** - * @author Gunnar Morling - */ -public class Customer { - - @Min(1) - @DecimalMin("1.00") - private final int status = 0; -} diff --git a/osgi/integrationtest/src/test/java/com/example/Event.java b/osgi/integrationtest/src/test/java/com/example/Event.java deleted file mode 100644 index 0d789a4e15..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/Event.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example; - -import java.time.LocalDate; - -import org.hibernate.validator.constraints.ScriptAssert; - -/** - * @author Marko Bekhta - */ -@ScriptAssert(lang = "groovy", script = "_this.start < _this.end", message = "start of event cannot be after the end") -public class Event { - - private final LocalDate start; - - private final LocalDate end; - - public Event(LocalDate start, LocalDate end) { - this.start = start; - this.end = end; - } - - @ScriptAssert(lang = "groovy", script = "true", message = "groovy message") - @ScriptAssert(lang = "ECMAScript", script = "true", message = "ECMAScript message") - public static class EventLocation { - - } -} diff --git a/osgi/integrationtest/src/test/java/com/example/ExampleConstraintValidatorFactory.java b/osgi/integrationtest/src/test/java/com/example/ExampleConstraintValidatorFactory.java deleted file mode 100644 index 47d146a9c8..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/ExampleConstraintValidatorFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example; - -import java.lang.reflect.InvocationTargetException; -import java.util.concurrent.atomic.AtomicInteger; -import jakarta.validation.ConstraintValidator; -import jakarta.validation.ConstraintValidatorFactory; - -/** - * A custom constraint validator factory, configured through META-INF/validation.xml. - * - * @author Gunnar Morling - */ -public class ExampleConstraintValidatorFactory implements ConstraintValidatorFactory { - - public static AtomicInteger invocationCounter = new AtomicInteger(); - - @Override - public > T getInstance(Class key) { - try { - return key.getConstructor().newInstance(); - } - catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException - | SecurityException e) { - throw new RuntimeException( e ); - } - finally { - invocationCounter.incrementAndGet(); - } - } - - @Override - public void releaseInstance(ConstraintValidator instance) { - } -} diff --git a/osgi/integrationtest/src/test/java/com/example/Order.java b/osgi/integrationtest/src/test/java/com/example/Order.java deleted file mode 100644 index 685e624fa3..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/Order.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example; - -/** - * @author Gunnar Morling - */ -public class Order { - - @SuppressWarnings("unused") - private final String name = null; -} diff --git a/osgi/integrationtest/src/test/java/com/example/RetailOrder.java b/osgi/integrationtest/src/test/java/com/example/RetailOrder.java deleted file mode 100644 index a67c5b1773..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/RetailOrder.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example; - -import com.example.constraint.ValidName; - -/** - * @author Gunnar Morling - */ -public class RetailOrder { - - @ValidName(message = "{com.example.RetailOrder.name.message}") - private final String name = null; -} diff --git a/osgi/integrationtest/src/test/java/com/example/constraint/ValidName.java b/osgi/integrationtest/src/test/java/com/example/constraint/ValidName.java deleted file mode 100644 index 67a2392b88..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/constraint/ValidName.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example.constraint; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import jakarta.validation.Constraint; -import jakarta.validation.Payload; - -/** - * @author Gunnar Morling - */ -@Constraint(validatedBy = {}) -@Documented -@Target({ METHOD, FIELD, TYPE }) -@Retention(RUNTIME) -public @interface ValidName { - String message() default "Invalid"; - - Class[] groups() default { }; - - Class[] payload() default { }; -} diff --git a/osgi/integrationtest/src/test/java/com/example/constraint/ValidNameValidator.java b/osgi/integrationtest/src/test/java/com/example/constraint/ValidNameValidator.java deleted file mode 100644 index 139731e8c6..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/constraint/ValidNameValidator.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example.constraint; - -import jakarta.validation.ConstraintValidator; -import jakarta.validation.ConstraintValidatorContext; - -/** - * @author Gunnar Morling - * - */ -public class ValidNameValidator implements ConstraintValidator { - - @Override - public void initialize(ValidName constraintAnnotation) { - } - - @Override - public boolean isValid(String value, ConstraintValidatorContext context) { - return false; - } -} diff --git a/osgi/integrationtest/src/test/java/com/example/constraintvalidator/Bean.java b/osgi/integrationtest/src/test/java/com/example/constraintvalidator/Bean.java deleted file mode 100644 index 2606452e7c..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/constraintvalidator/Bean.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example.constraintvalidator; - -public class Bean { - - @MustMatch("Foo") - public String getFoo() { - return "Bar"; - } -} diff --git a/osgi/integrationtest/src/test/java/com/example/constraintvalidator/MustMatch.java b/osgi/integrationtest/src/test/java/com/example/constraintvalidator/MustMatch.java deleted file mode 100644 index 2691be1493..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/constraintvalidator/MustMatch.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example.constraintvalidator; - -import java.lang.annotation.Documented; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -import jakarta.validation.Constraint; -import jakarta.validation.Payload; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -@Documented -@Constraint(validatedBy = { }) -@Target({ METHOD, FIELD }) -@Retention(RUNTIME) -public @interface MustMatch { - String message() default "{com.example.constraintvalidator.MustMatch.message}"; - - Class[] groups() default { }; - - Class[] payload() default { }; - - String value(); -} diff --git a/osgi/integrationtest/src/test/java/com/example/constraintvalidator/MustMatchValidator.java b/osgi/integrationtest/src/test/java/com/example/constraintvalidator/MustMatchValidator.java deleted file mode 100644 index 9b3c434821..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/constraintvalidator/MustMatchValidator.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example.constraintvalidator; - -import jakarta.validation.ConstraintValidator; -import jakarta.validation.ConstraintValidatorContext; - - -public class MustMatchValidator implements ConstraintValidator { - - private String match; - - @Override - public void initialize(MustMatch constraintAnnotation) { - this.match = constraintAnnotation.value(); - } - - @Override - public boolean isValid(String value, ConstraintValidatorContext context) { - if ( value == null ) { - return true; - } - - return value.equals( match ); - } -} diff --git a/osgi/integrationtest/src/test/java/com/example/money/ExternalClassLoaderJavaxMoneyServiceProvider.java b/osgi/integrationtest/src/test/java/com/example/money/ExternalClassLoaderJavaxMoneyServiceProvider.java deleted file mode 100644 index fbdf9aa8b7..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/money/ExternalClassLoaderJavaxMoneyServiceProvider.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example.money; - -import java.util.ArrayList; -import java.util.List; -import java.util.ServiceLoader; - -import javax.money.spi.ServiceProvider; - -/** - * A javax.money {@link ServiceProvider} using a given class loader. - * - * @author Guillaume Smet - */ -public class ExternalClassLoaderJavaxMoneyServiceProvider implements ServiceProvider { - - private final ClassLoader classLoader; - - public ExternalClassLoaderJavaxMoneyServiceProvider(ClassLoader externalClassLoader) { - this.classLoader = externalClassLoader; - } - - @Override - public int getPriority() { - return 0; - } - - @Override - public List getServices(final Class serviceType) { - List services = new ArrayList<>(); - for ( T service : ServiceLoader.load( serviceType, classLoader ) ) { - services.add( service ); - } - - return services; - } -} diff --git a/osgi/integrationtest/src/test/java/com/example/money/JavaxMoneyOrder.java b/osgi/integrationtest/src/test/java/com/example/money/JavaxMoneyOrder.java deleted file mode 100644 index 7c796f5379..0000000000 --- a/osgi/integrationtest/src/test/java/com/example/money/JavaxMoneyOrder.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package com.example.money; - -import javax.money.MonetaryAmount; -import jakarta.validation.constraints.DecimalMin; -import jakarta.validation.constraints.NotBlank; - -import org.hibernate.validator.constraints.Currency; - -/** - * @author Guillaume Smet - */ -public class JavaxMoneyOrder { - - @NotBlank - private String name; - - @DecimalMin(value = "100") - @Currency("EUR") - private MonetaryAmount amount; - - public JavaxMoneyOrder(String name, MonetaryAmount amount) { - this.name = name; - this.amount = amount; - } -} diff --git a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/JavaVersionUtil.java b/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/JavaVersionUtil.java deleted file mode 100644 index a38a53ac71..0000000000 --- a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/JavaVersionUtil.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package org.hibernate.validator.osgi.integrationtest; - -import java.util.Locale; - -final class JavaVersionUtil { - - private JavaVersionUtil() { - } - - static int getMajorVersion() { - String javaSpecVersion = System.getProperty( "java.specification.version" ); - try { - if ( javaSpecVersion.contains( "." ) ) { //before jdk 9 - return Integer.parseInt( javaSpecVersion.split( "\\." )[1] ); - } - else { - return Integer.parseInt( javaSpecVersion ); - } - } - catch (NumberFormatException e) { - throw new IllegalArgumentException( String.format( Locale.ROOT, "We are unable to parse Java version '%1$s'.", javaSpecVersion ) ); - } - } -} diff --git a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/KarafFeaturesAreInstallableTest.java b/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/KarafFeaturesAreInstallableTest.java deleted file mode 100644 index 2fba3b2e68..0000000000 --- a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/KarafFeaturesAreInstallableTest.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package org.hibernate.validator.osgi.integrationtest; - -import static org.hibernate.validator.osgi.integrationtest.PaxExamOptions.JAVA_9; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.ops4j.pax.exam.CoreOptions.maven; -import static org.ops4j.pax.exam.CoreOptions.options; -import static org.ops4j.pax.exam.CoreOptions.systemProperty; -import static org.ops4j.pax.exam.CoreOptions.when; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; - -import java.io.File; -import java.net.URI; -import java.util.Locale; - -import javax.inject.Inject; - -import org.apache.karaf.features.Feature; -import org.apache.karaf.features.FeaturesService; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.karaf.options.LogLevelOption; -import org.ops4j.pax.exam.options.MavenArtifactUrlReference; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; - -/** - * Integration test for Bean Validation and Hibernate Validator under OSGi. - *

- * This test makes sure that the Karaf features provided by this project are installable. - *

- * Note that if a feature is not installable, the test gets stuck for a while but it is a - * good indication that something is wrong. - * - * @author Toni Menzel (toni@rebaze.com) - */ -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class KarafFeaturesAreInstallableTest { - - @Inject - private FeaturesService featuresService; - - private static final boolean DEBUG = false; - - @Configuration - public Option[] config() { - MavenArtifactUrlReference hibernateValidatorFeature = maven() - .groupId( "org.hibernate.validator" ) - .artifactId( "hibernate-validator-osgi-karaf-features" ) - .classifier( "features" ) - .type( "xml" ) - .versionAsInProject(); - - String mavenLocalRepository = System.getProperty( "maven.settings.localRepository" ); - String mavenCentralRepository = System.getProperty( "maven.mavencentral.repo.url" ); - - return options( - when( DEBUG ).useOptions( debugConfiguration( "5005", true ) ), - when( JavaVersionUtil.getMajorVersion() >= 9 ).useOptions( JAVA_9.options() ), - karafDistributionConfiguration() - .frameworkUrl( - maven() - .groupId( "org.apache.karaf" ) - .artifactId( "apache-karaf" ) - .type( "tar.gz" ) - .versionAsInProject() - ) - .unpackDirectory( new File( "target/exam" ) ) - .useDeployFolder( false ), - configureConsole() - .ignoreLocalConsole() - .ignoreRemoteShell(), - when( DEBUG ).useOptions( keepRuntimeFolder() ), - logLevel( LogLevelOption.LogLevel.INFO ), - // avoiding additional boot features; specifically "enterprise" which already comes with a HV feature - // "system" is the absolute minimum, but enough for our purposes - editConfigurationFilePut( - "etc/org.apache.karaf.features.cfg", - "featuresBoot", - "system" - ), - /* - * Use the same local Maven repository as the build job. - * This allows to retrieve the just-installed artifacts in case - * the local repo was overridden from the command line. - * - * See https://ops4j1.jira.com/wiki/spaces/paxurl/pages/3833866/Mvn+Protocol for more information - * on the configuration below. - */ - editConfigurationFilePut( - "etc/org.ops4j.pax.url.mvn.cfg", - "org.ops4j.pax.url.mvn.defaultRepositories", - "file://" + mavenLocalRepository - + "@snapshots" - + "@id=local-repo-from-maven-settings" - ), - editConfigurationFilePut( - "etc/org.ops4j.pax.url.mvn.cfg", - "org.ops4j.pax.url.mvn.localRepository", - mavenLocalRepository - ), - editConfigurationFilePut( // Erase the defaults: Maven Central uses HTTP by default... - "etc/org.ops4j.pax.url.mvn.cfg", - "org.ops4j.pax.url.mvn.repositories", - mavenCentralRepository + "@id=central" - ), - systemProperty( "validatorRepositoryUrl" ).value( hibernateValidatorFeature.getURL() ) - ); - } - - @BeforeClass - public static void setLocaleToEnglish() { - Locale.setDefault( Locale.ENGLISH ); - } - - @Test - public void canInstallFeatureHibernateValidator() throws Exception { - featuresService.addRepository( new URI( System.getProperty( "validatorRepositoryUrl" ) ) ); - canInstallFeature( "hibernate-validator" ); - } - - @Test - public void canInstallFeatureHibernateValidatorJodaTime() throws Exception { - featuresService.addRepository( new URI( System.getProperty( "validatorRepositoryUrl" ) ) ); - canInstallFeature( "hibernate-validator-joda-time" ); - } - - @Test - public void canInstallFeatureHibernateValidatorJavaxMoney() throws Exception { - featuresService.addRepository( new URI( System.getProperty( "validatorRepositoryUrl" ) ) ); - canInstallFeature( "hibernate-validator-javax-money" ); - } - - @Test - public void canInstallFeatureHibernateValidatorGroovy() throws Exception { - featuresService.addRepository( new URI( System.getProperty( "validatorRepositoryUrl" ) ) ); - canInstallFeature( "hibernate-validator-groovy" ); - } - - @Test - public void canInstallFeatureHibernateValidatorParanamer() throws Exception { - featuresService.addRepository( new URI( System.getProperty( "validatorRepositoryUrl" ) ) ); - canInstallFeature( "hibernate-validator-paranamer" ); - } - - public void canInstallFeature(String featureName) throws Exception { - Feature feature = featuresService.getFeature( featureName ); - assertNotNull( "Feature " + featureName + " is not available from features list", feature ); - featuresService.installFeature( featureName ); - assertTrue( "Feature " + featureName + " isn't installed, though available from features list", featuresService.isInstalled( feature ) ); - } -} diff --git a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/OsgiIntegrationTest.java b/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/OsgiIntegrationTest.java deleted file mode 100644 index 0f08d9211c..0000000000 --- a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/OsgiIntegrationTest.java +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package org.hibernate.validator.osgi.integrationtest; - -import static org.hibernate.validator.osgi.integrationtest.PaxExamOptions.JAVA_9; -import static org.junit.Assert.assertEquals; -import static org.ops4j.pax.exam.CoreOptions.maven; -import static org.ops4j.pax.exam.CoreOptions.options; -import static org.ops4j.pax.exam.CoreOptions.when; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; - -import java.io.File; -import java.time.LocalDate; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Set; -import java.util.stream.Collectors; - -import jakarta.el.ELManager; -import jakarta.el.ExpressionFactory; -import javax.money.spi.Bootstrap; -import javax.script.ScriptEngineFactory; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.Validation; -import jakarta.validation.ValidationProviderResolver; -import jakarta.validation.Validator; -import jakarta.validation.spi.ValidationProvider; - -import org.codehaus.groovy.jsr223.GroovyScriptEngineFactory; -import org.hibernate.validator.HibernateValidator; -import org.hibernate.validator.HibernateValidatorConfiguration; -import org.hibernate.validator.constraints.ScriptAssert; -import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; -import org.hibernate.validator.osgi.scripting.MultiClassLoaderScriptEvaluatorFactory; -import org.hibernate.validator.osgi.scripting.OsgiScriptEvaluatorFactory; -import org.hibernate.validator.resourceloading.PlatformResourceBundleLocator; -import org.javamoney.moneta.Money; -import org.javamoney.moneta.spi.MonetaryConfig; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.karaf.options.LogLevelOption; -import org.ops4j.pax.exam.options.MavenUrlReference; -import org.osgi.framework.FrameworkUtil; - -import com.example.Customer; -import com.example.Event; -import com.example.ExampleConstraintValidatorFactory; -import com.example.Order; -import com.example.RetailOrder; -import com.example.constraintvalidator.Bean; -import com.example.constraintvalidator.MustMatch; -import com.example.money.ExternalClassLoaderJavaxMoneyServiceProvider; -import com.example.money.JavaxMoneyOrder; - -/** - * Integration test for Bean Validation and Hibernate Validator under OSGi. - *

- * Note that the example classes used by this test are located in the {@code com.example} package to avoid that they are - * handled as parts of Hibernate Validator during class loading. - * - * @author Gunnar Morling - */ -@RunWith(PaxExam.class) -public class OsgiIntegrationTest { - - private static final boolean DEBUG = false; - - @Configuration - public Option[] config() { - MavenUrlReference hibernateValidatorFeature = maven() - .groupId( "org.hibernate.validator" ) - .artifactId( "hibernate-validator-osgi-karaf-features" ) - .classifier( "features" ) - .type( "xml" ) - .versionAsInProject(); - - String mavenLocalRepository = System.getProperty( "maven.settings.localRepository" ); - String mavenCentralRepository = System.getProperty( "maven.mavencentral.repo.url" ); - - return options( - when( DEBUG ).useOptions( debugConfiguration( "5005", true ) ), - when( JavaVersionUtil.getMajorVersion() >= 9 ).useOptions( JAVA_9.options() ), - karafDistributionConfiguration() - .frameworkUrl( - maven() - .groupId( "org.apache.karaf" ) - .artifactId( "apache-karaf" ) - .type( "tar.gz" ) - .versionAsInProject() - ) - .unpackDirectory( new File( "target/exam" ) ) - .useDeployFolder( false ), - configureConsole() - .ignoreLocalConsole() - .ignoreRemoteShell(), - when( DEBUG ).useOptions( keepRuntimeFolder() ), - logLevel( LogLevelOption.LogLevel.INFO ), - // avoiding additional boot features; specifically "enterprise" which already comes with a HV feature - // "system" is the absolute minimum, but enough for our purposes - editConfigurationFilePut( - "etc/org.apache.karaf.features.cfg", - "featuresBoot", - "system" - ), - /* - * Use the same local Maven repository as the build job. - * This allows to retrieve the just-installed artifacts in case - * the local repo was overridden from the command line. - * - * See https://ops4j1.jira.com/wiki/spaces/paxurl/pages/3833866/Mvn+Protocol for more information - * on the configuration below. - */ - editConfigurationFilePut( - "etc/org.ops4j.pax.url.mvn.cfg", - "org.ops4j.pax.url.mvn.defaultRepositories", - "file://" + mavenLocalRepository - + "@snapshots" - + "@id=local-repo-from-maven-settings" - ), - editConfigurationFilePut( - "etc/org.ops4j.pax.url.mvn.cfg", - "org.ops4j.pax.url.mvn.localRepository", - mavenLocalRepository - ), - editConfigurationFilePut( // Erase the defaults: Maven Central uses HTTP by default... - "etc/org.ops4j.pax.url.mvn.cfg", - "org.ops4j.pax.url.mvn.repositories", - mavenCentralRepository + "@id=central" - ), - features( hibernateValidatorFeature, "hibernate-validator", "hibernate-validator-joda-time", - "hibernate-validator-javax-money", "hibernate-validator-groovy" ) - ); - } - - @BeforeClass - public static void setLocaleToEnglish() { - Locale.setDefault( Locale.ENGLISH ); - } - - @Test - public void canObtainValidatorFactoryAndPerformValidationWithDefaultMessageInterpolator() { - Set> constraintViolations = Validation.byDefaultProvider() - .providerResolver( new MyValidationProviderResolver() ) - .configure() - .ignoreXmlConfiguration() - .buildValidatorFactory() - .getValidator() - .validate( new Customer() ); - - Set actualMessages = constraintViolations.stream() - .map( ConstraintViolation::getMessage ) - .collect( Collectors.toSet() ); - - Set expectedMessages = new HashSet<>(); - expectedMessages.add( "must be greater than or equal to 1" ); - expectedMessages.add( "must be greater than or equal to 1.00" ); - - assertEquals( expectedMessages, actualMessages ); - } - - @Test - public void canUseExpressionLanguageInConstraintMessageWithExternallyConfiguredExpressionFactory() { - ExpressionFactory expressionFactory = buildExpressionFactory(); - - Set> constraintViolations = Validation.byProvider( HibernateValidator.class ) - .configure() - .ignoreXmlConfiguration() - .externalClassLoader( getClass().getClassLoader() ) - .messageInterpolator( new ResourceBundleMessageInterpolator( - new PlatformResourceBundleLocator( ResourceBundleMessageInterpolator.USER_VALIDATION_MESSAGES ), - true, - expressionFactory ) - ) - .buildValidatorFactory() - .getValidator() - .validate( new Customer() ); - - Set actualMessages = constraintViolations.stream() - .map( ConstraintViolation::getMessage ) - .collect( Collectors.toSet() ); - - Set expectedMessages = new HashSet<>(); - expectedMessages.add( "must be greater than or equal to 1" ); - expectedMessages.add( "must be greater than or equal to 1.00" ); - - assertEquals( expectedMessages, actualMessages ); - } - - @Test - public void canConfigureCustomConstraintValidatorFactoryViaValidationXml() { - ExampleConstraintValidatorFactory.invocationCounter.set( 0 ); - - HibernateValidatorConfiguration configuration = Validation.byProvider( HibernateValidator.class ) - .configure() - .externalClassLoader( getClass().getClassLoader() ); - - String constraintValidatorFactoryClassName = configuration.getBootstrapConfiguration() - .getConstraintValidatorFactoryClassName(); - - assertEquals( - "META-INF/validation.xml could not be read", - ExampleConstraintValidatorFactory.class.getName(), - constraintValidatorFactoryClassName - ); - - configuration.buildValidatorFactory() - .getValidator() - .validate( new Customer() ); - - assertEquals( 1, ExampleConstraintValidatorFactory.invocationCounter.get() ); - } - - @Test - public void canConfigureConstraintViaXmlMapping() { - Validator validator = Validation.byProvider( HibernateValidator.class ) - .configure() - .externalClassLoader( getClass().getClassLoader() ) - .buildValidatorFactory() - .getValidator(); - - Set> customerViolations = validator.validate( new Customer() ); - - assertEquals( 1, customerViolations.size() ); - assertEquals( "must be greater than or equal to 2", customerViolations.iterator().next().getMessage() ); - - // custom constraint configured in XML - Set> orderViolations = validator.validate( new Order() ); - - assertEquals( 1, orderViolations.size() ); - assertEquals( "Invalid", orderViolations.iterator().next().getMessage() ); - } - - @Test - public void canObtainValuesFromValidationMessages() { - Set> constraintViolations = Validation.byProvider( HibernateValidator.class ) - .configure() - .externalClassLoader( getClass().getClassLoader() ) - .buildValidatorFactory() - .getValidator() - .validate( new RetailOrder() ); - - assertEquals( 1, constraintViolations.size() ); - assertEquals( "Not a valid retail order name", constraintViolations.iterator().next().getMessage() ); - } - - @Test - public void canUseJavaxMoneyConstraints() { - Bootstrap.init( new ExternalClassLoaderJavaxMoneyServiceProvider( MonetaryConfig.class.getClassLoader() ) ); - - Validator validator = Validation.byProvider( HibernateValidator.class ) - .configure() - .externalClassLoader( getClass().getClassLoader() ) - .buildValidatorFactory() - .getValidator(); - - Set> constraintViolations = validator.validate( new JavaxMoneyOrder( "Order 1", Money.of( 0, "EUR" ) ) ); - - assertEquals( 1, constraintViolations.size() ); - assertEquals( "must be greater than or equal to 100", constraintViolations.iterator().next().getMessage() ); - - constraintViolations = validator.validate( new JavaxMoneyOrder( "Order 1", Money.of( 120, "USD" ) ) ); - - assertEquals( 1, constraintViolations.size() ); - assertEquals( "invalid currency (must be one of [EUR])", constraintViolations.iterator().next().getMessage() ); - } - - @Test - public void constraintDefinitionsCanBeConfiguredViaServiceLoader() { - Validator validator = Validation.byProvider( HibernateValidator.class ) - .configure() - .externalClassLoader( getClass().getClassLoader() ) - .buildValidatorFactory() - .getValidator(); - - Set> constraintViolations = validator.validate( new Bean() ); - assertEquals( 1, constraintViolations.size() ); - assertEquals( MustMatch.class, constraintViolations.iterator().next().getConstraintDescriptor().getAnnotation().annotationType() ); - } - - @Test - public void canUseScriptAssertConstraintWithMultiClassLoaderScriptEvaluatorFactory() { - //tag::scriptEvaluatorFactoryMultiClassLoaderScriptEvaluatorFactory[] - Validator validator = Validation.byProvider( HibernateValidator.class ) - .configure() - .scriptEvaluatorFactory( - new MultiClassLoaderScriptEvaluatorFactory( GroovyScriptEngineFactory.class.getClassLoader() ) - ) - .buildValidatorFactory() - .getValidator(); - //end::scriptEvaluatorFactoryMultiClassLoaderScriptEvaluatorFactory[] - - canUseScriptAssertConstraint( validator ); - } - - @Test - public void canUseScriptAssertConstraintWithOsgiScriptEvaluatorFactory() { - //tag::scriptEvaluatorFactoryOsgiScriptEvaluatorFactory[] - Validator validator = Validation.byProvider( HibernateValidator.class ) - .configure() - .scriptEvaluatorFactory( - new OsgiScriptEvaluatorFactory( FrameworkUtil.getBundle( this.getClass() ).getBundleContext() ) - ) - .buildValidatorFactory() - .getValidator(); - //end::scriptEvaluatorFactoryOsgiScriptEvaluatorFactory[] - - canUseScriptAssertConstraint( validator ); - } - - private void canUseScriptAssertConstraint(Validator validator) { - Set> constraintViolations = validator.validate( new Event( LocalDate.of( 2017, 8, 8 ), LocalDate.of( 2016, 8, 8 ) ) ); - assertEquals( 1, constraintViolations.size() ); - assertEquals( "start of event cannot be after the end", constraintViolations.iterator().next().getMessage() ); - assertEquals( ScriptAssert.class, constraintViolations.iterator().next().getConstraintDescriptor().getAnnotation().annotationType() ); - } - - @Test - public void canUseVariousScriptingLanguagesInScripAssertConstraint() { - Validator validator = Validation.byProvider( HibernateValidator.class ) - .configure() - .externalClassLoader( getClass().getClassLoader() ) - .scriptEvaluatorFactory( - new MultiClassLoaderScriptEvaluatorFactory( - GroovyScriptEngineFactory.class.getClassLoader(), - ScriptEngineFactory.class.getClassLoader() // for JS - ) - ).buildValidatorFactory() - .getValidator(); - - Set> constraintViolations = validator.validate( new Event.EventLocation() ); - assertEquals( 0, constraintViolations.size() ); - } - - private ExpressionFactory buildExpressionFactory() { - ClassLoader oldTccl = Thread.currentThread().getContextClassLoader(); - Thread.currentThread().setContextClassLoader( getClass().getClassLoader() ); - - try { - return ELManager.getExpressionFactory(); - } - finally { - Thread.currentThread().setContextClassLoader( oldTccl ); - } - } - - public static class MyValidationProviderResolver implements ValidationProviderResolver { - - @Override - public List> getValidationProviders() { - return Collections.>singletonList( new HibernateValidator() ); - } - } -} diff --git a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/PaxExamOptions.java b/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/PaxExamOptions.java deleted file mode 100644 index cf8166b46d..0000000000 --- a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/integrationtest/PaxExamOptions.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package org.hibernate.validator.osgi.integrationtest; - -import org.ops4j.pax.exam.CoreOptions; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.options.DefaultCompositeOption; - -public enum PaxExamOptions { - JAVA_9( - CoreOptions.vmOptions( - "--add-opens", - "java.base/java.security=ALL-UNNAMED", - "--add-opens", - "java.base/java.net=ALL-UNNAMED", - "--add-opens", - "java.base/java.lang=ALL-UNNAMED", - "--add-opens", - "java.base/java.util=ALL-UNNAMED", - "--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED", - "--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED", - "--add-exports=java.xml.bind/com.sun.xml.internal.bind.v2.runtime=ALL-UNNAMED", - "--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED", - "--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED", - "--add-exports=java.xml.ws/com.sun.xml.internal.messaging.saaj.soap.impl=ALL-UNNAMED", - "--add-modules", - "java.xml.ws.annotation,java.corba,java.transaction,java.xml.bind,java.xml.ws,jdk.xml.bind" ) - ); - - private final Option options; - - PaxExamOptions(Option... options) { - this.options = new DefaultCompositeOption( options ); - } - - public Option options() { - return options; - } -} diff --git a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/scripting/OsgiScriptEvaluatorFactory.java b/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/scripting/OsgiScriptEvaluatorFactory.java deleted file mode 100644 index c5d594a1f7..0000000000 --- a/osgi/integrationtest/src/test/java/org/hibernate/validator/osgi/scripting/OsgiScriptEvaluatorFactory.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Hibernate Validator, declare and validate application constraints - * - * License: Apache License, Version 2.0 - * See the license.txt file in the root directory or . - */ -package org.hibernate.validator.osgi.scripting; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URL; -import java.util.Arrays; -import java.util.Collections; -import java.util.Enumeration; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import javax.script.ScriptEngineFactory; -import javax.script.ScriptEngineManager; -import jakarta.validation.ValidationException; - -import org.hibernate.validator.spi.scripting.AbstractCachingScriptEvaluatorFactory; -import org.hibernate.validator.spi.scripting.ScriptEngineScriptEvaluator; -import org.hibernate.validator.spi.scripting.ScriptEvaluator; -import org.hibernate.validator.spi.scripting.ScriptEvaluatorFactory; -import org.hibernate.validator.spi.scripting.ScriptEvaluatorNotFoundException; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; - -/** - * {@link ScriptEvaluatorFactory} suitable for OSGi environments. It is created - * based on the {@code BundleContext} which is used to iterate through {@code Bundle}s and find all {@link ScriptEngineFactory} - * candidates. - * - * @author Marko Bekhta - */ -public class OsgiScriptEvaluatorFactory extends AbstractCachingScriptEvaluatorFactory { - - private final List scriptEngineManagers; - - public OsgiScriptEvaluatorFactory(BundleContext context) { - this.scriptEngineManagers = Collections.unmodifiableList( findManagers( context ) ); - } - - @Override - protected ScriptEvaluator createNewScriptEvaluator(String languageName) throws ScriptEvaluatorNotFoundException { - return scriptEngineManagers.stream() - .map( manager -> manager.getEngineByName( languageName ) ) - .filter( Objects::nonNull ) - .map( engine -> new ScriptEngineScriptEvaluator( engine ) ) - .findFirst() - .orElseThrow( () -> new ValidationException( String.format( "Unable to find script evaluator for '%s'.", languageName ) ) ); - } - - private List findManagers(BundleContext context) { - return findFactoryCandidates( context ).stream() - .map( className -> { - try { - return new ScriptEngineManager( Class.forName( className ).getClassLoader() ); - } - catch (ClassNotFoundException e) { - throw new ValidationException( "Unable to instantiate '" + className + "' based engine factory manager.", e ); - } - } ).collect( Collectors.toList() ); - } - - /** - * Iterates through all bundles to get the available {@link ScriptEngineFactory} classes - * - * @return the names of the available ScriptEngineFactory classes - * - * @throws IOException - */ - private List findFactoryCandidates(BundleContext context) { - return Arrays.stream( context.getBundles() ) - .filter( Objects::nonNull ) - .filter( bundle -> !"system.bundle".equals( bundle.getSymbolicName() ) ) - .flatMap( this::toStreamOfResourcesURL ) - .filter( Objects::nonNull ) - .flatMap( url -> toListOfFactoryCandidates( url ).stream() ) - .collect( Collectors.toList() ); - } - - private Stream toStreamOfResourcesURL(Bundle bundle) { - Enumeration entries = bundle.findEntries( - "META-INF/services", - "javax.script.ScriptEngineFactory", - false - ); - return entries != null ? Collections.list( entries ).stream() : Stream.empty(); - } - - private List toListOfFactoryCandidates(URL url) { - try ( BufferedReader reader = new BufferedReader( new InputStreamReader( url.openStream(), "UTF-8" ) ) ) { - return reader.lines() - .map( String::trim ) - .filter( line -> !line.isEmpty() ) - .filter( line -> !line.startsWith( "#" ) ) - .collect( Collectors.toList() ); - } - catch (IOException e) { - throw new ValidationException( "Unable to read the ScriptEngineFactory resource file", e ); - } - } -} diff --git a/osgi/integrationtest/src/test/resources/META-INF/constraint-mappings.xml b/osgi/integrationtest/src/test/resources/META-INF/constraint-mappings.xml deleted file mode 100644 index 9901963ba8..0000000000 --- a/osgi/integrationtest/src/test/resources/META-INF/constraint-mappings.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - com.example - - - - - 2 - - - - - - - - - - - - - com.example.constraint.ValidNameValidator - - - diff --git a/osgi/integrationtest/src/test/resources/META-INF/services/jakarta.validation.ConstraintValidator b/osgi/integrationtest/src/test/resources/META-INF/services/jakarta.validation.ConstraintValidator deleted file mode 100644 index 9c096b8fe2..0000000000 --- a/osgi/integrationtest/src/test/resources/META-INF/services/jakarta.validation.ConstraintValidator +++ /dev/null @@ -1 +0,0 @@ -com.example.constraintvalidator.MustMatchValidator diff --git a/osgi/integrationtest/src/test/resources/META-INF/validation.xml b/osgi/integrationtest/src/test/resources/META-INF/validation.xml deleted file mode 100644 index 920c3d2189..0000000000 --- a/osgi/integrationtest/src/test/resources/META-INF/validation.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - com.example.ExampleConstraintValidatorFactory - - - META-INF/constraint-mappings.xml - diff --git a/osgi/integrationtest/src/test/resources/ValidationMessages.properties b/osgi/integrationtest/src/test/resources/ValidationMessages.properties deleted file mode 100644 index 41e6c5dbe3..0000000000 --- a/osgi/integrationtest/src/test/resources/ValidationMessages.properties +++ /dev/null @@ -1,7 +0,0 @@ -# -# Hibernate Validator, declare and validate application constraints -# -# License: Apache License, Version 2.0 -# See the license.txt file in the root directory or . -# -com.example.RetailOrder.name.message=Not a valid retail order name diff --git a/osgi/integrationtest/src/test/resources/log4j.properties b/osgi/integrationtest/src/test/resources/log4j.properties deleted file mode 100644 index 6e6c7c0720..0000000000 --- a/osgi/integrationtest/src/test/resources/log4j.properties +++ /dev/null @@ -1,8 +0,0 @@ -### direct log messages to stdout ### -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.Target=System.out -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n - -### set log levels - for more verbose logging change 'info' to 'debug' ### -log4j.rootLogger=debug, stdout diff --git a/osgi/karaf-features/pom.xml b/osgi/karaf-features/pom.xml deleted file mode 100644 index c8f5e3c91a..0000000000 --- a/osgi/karaf-features/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - 4.0.0 - - - org.hibernate.validator - hibernate-validator-osgi - 8.0.0-SNAPSHOT - - - hibernate-validator-osgi-karaf-features - pom - - Hibernate Validator Karaf Features - Hibernate Validator features for Apache Karaf - - - ../.. - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - features - generate-resources - - copy-resources - - - - - src/main/features - true - - - target/features - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - package - - attach-artifact - - - - - target/features/features.xml - xml - features - - - - - - - - maven-checkstyle-plugin - - - de.thetaphi - forbiddenapis - - - - diff --git a/osgi/karaf-features/src/main/features/features.xml b/osgi/karaf-features/src/main/features/features.xml deleted file mode 100644 index ece1dc5284..0000000000 --- a/osgi/karaf-features/src/main/features/features.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - mvn:org.hibernate.validator/hibernate-validator/${project.version} - mvn:jakarta.validation/jakarta.validation-api/${version.jakarta.validation-api} - - mvn:org.jboss.logging/jboss-logging/${version.org.jboss.logging.jboss-logging} - mvn:com.fasterxml/classmate/${version.com.fasterxml.classmate} - mvn:jakarta.el/jakarta.el-api/${version.jakarta.el-api} - mvn:org.glassfish.expressly/expressly/${version.org.glassfish.expressly} - - - hibernate-validator - mvn:joda-time/joda-time/${version.joda-time} - - - hibernate-validator - mvn:javax.money/money-api/${version.javax.money} - mvn:org.javamoney/moneta/${version.org.javamoney.moneta} - - - hibernate-validator - mvn:org.codehaus.groovy/groovy-all/${version.org.codehaus.groovy} - - - wrap - hibernate-validator - wrap:mvn:com.thoughtworks.paranamer/paranamer/${version.com.thoughtworks.paranamer} - - diff --git a/osgi/pom.xml b/osgi/pom.xml deleted file mode 100644 index 9a323b4251..0000000000 --- a/osgi/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - 4.0.0 - - - org.hibernate.validator - hibernate-validator-parent - 8.0.0-SNAPSHOT - - - hibernate-validator-osgi - pom - - Hibernate Validator OSGi Modules - Hibernate Validator OSGi modules aggregator - - - .. - - - - karaf-features - integrationtest - - - - - testWithJdk8 - - - java-version.test.release - 8 - - - - - felixtest - - - - diff --git a/pom.xml b/pom.xml index 22ac33c52c..1a458c9199 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ pom Hibernate Validator Aggregator - http://hibernate.org/validator + https://hibernate.org/validator Aggregator of the Hibernate Validator modules. @@ -211,7 +211,6 @@ 4.2.0 4.12.0 2.5.4 - 6.0.0 5.2020.2 2.3.1 @@ -462,11 +461,6 @@ byte-buddy ${version.net.bytebuddy.byte-buddy} - - org.osgi - org.osgi.core - ${version.org.osgi.core} - org.apache.logging.log4j log4j-core @@ -741,7 +735,7 @@ ${project.version} ${project.parent.groupId} ${project.parent.groupId} - http://hibernate.org/validator/ + https://hibernate.org/validator/ diff --git a/relocation/karaf-features/pom.xml b/relocation/karaf-features/pom.xml deleted file mode 100644 index b0583a875a..0000000000 --- a/relocation/karaf-features/pom.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - 4.0.0 - - org.hibernate.validator - hibernate-validator-relocation - 9.0.0-SNAPSHOT - - - org.hibernate - hibernate-validator-osgi-karaf-features - Hibernate Validator Karaf Features - Relocation Artifacts - - - - org.hibernate.validator - - -