You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2020/03/30 06:38:40 UTC

[syncope] branch 2_1_X updated: Replacing Hibernate Validator with Apache BVal (#169)

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/2_1_X by this push:
     new 3edc749  Replacing Hibernate Validator with Apache BVal (#169)
3edc749 is described below

commit 3edc7490da72fad3bd46a72b5e86227db27c4476
Author: Francesco Chicchiriccò <il...@users.noreply.github.com>
AuthorDate: Mon Mar 30 08:38:33 2020 +0200

    Replacing Hibernate Validator with Apache BVal (#169)
---
 core/logic/pom.xml                                 |  5 ---
 core/persistence-jpa/pom.xml                       | 12 ++---
 core/provisioning-java/pom.xml                     |  5 ---
 .../rest-cxf/src/main/resources/restCXFContext.xml |  6 +--
 .../src/main/resources/restSCIMv2CXFContext.xml    |  6 +--
 fit/build-tools/pom.xml                            |  5 +++
 .../webapp/WEB-INF/jboss-deployment-structure.xml  |  4 +-
 fit/core-reference/pom.xml                         | 52 ++++++----------------
 .../src/main/resources/jboss/restCXFContext.xml    |  6 +--
 fit/core-reference/src/main/resources/log4j2.xml   |  2 +-
 .../src/main/webapp/WEB-INF/glassfish-web.xml      |  3 +-
 .../webapp/WEB-INF/jboss-deployment-structure.xml  |  2 +
 pom.xml                                            | 13 ++----
 .../systemadministration/javaeecontainer.adoc      | 32 ++++++++++++-
 src/site/xdoc/building.xml                         |  5 ---
 15 files changed, 68 insertions(+), 90 deletions(-)

diff --git a/core/logic/pom.xml b/core/logic/pom.xml
index 19eccdc..6429d8c 100644
--- a/core/logic/pom.xml
+++ b/core/logic/pom.xml
@@ -97,11 +97,6 @@ under the License.
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>javax.el</groupId>
-      <artifactId>javax.el-api</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>org.apache.syncope.core</groupId>
       <artifactId>syncope-core-persistence-jpa</artifactId>
       <version>${project.version}</version>
diff --git a/core/persistence-jpa/pom.xml b/core/persistence-jpa/pom.xml
index bdbfbdc..fe3789b 100644
--- a/core/persistence-jpa/pom.xml
+++ b/core/persistence-jpa/pom.xml
@@ -62,14 +62,10 @@ under the License.
     </dependency>
       
     <dependency>
-      <groupId>org.hibernate.validator</groupId>
-      <artifactId>hibernate-validator</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.glassfish</groupId>
-      <artifactId>javax.el</artifactId>
-    </dependency>
-      
+      <groupId>org.apache.bval</groupId>
+      <artifactId>bval-jsr</artifactId>
+    </dependency>      
+
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-tx</artifactId>
diff --git a/core/provisioning-java/pom.xml b/core/provisioning-java/pom.xml
index 3f46f73..f783f32 100644
--- a/core/provisioning-java/pom.xml
+++ b/core/provisioning-java/pom.xml
@@ -111,11 +111,6 @@ under the License.
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>javax.el</groupId>
-      <artifactId>javax.el-api</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>org.apache.syncope.core</groupId>
       <artifactId>syncope-core-persistence-jpa</artifactId>
       <version>${project.version}</version>
diff --git a/core/rest-cxf/src/main/resources/restCXFContext.xml b/core/rest-cxf/src/main/resources/restCXFContext.xml
index b611a9b..2d5ca80 100644
--- a/core/rest-cxf/src/main/resources/restCXFContext.xml
+++ b/core/rest-cxf/src/main/resources/restCXFContext.xml
@@ -78,10 +78,7 @@ under the License.
   <bean id="validationInInterceptor" class="org.apache.cxf.jaxrs.validation.JAXRSBeanValidationInInterceptor">
     <property name="provider" ref="validationProvider"/>
   </bean>
-  <bean id="validationOutInterceptor" class="org.apache.cxf.jaxrs.validation.JAXRSBeanValidationOutInterceptor">
-    <property name="provider" ref="validationProvider"/>
-  </bean>   
-  
+
   <bean id="gzipInInterceptor" class="org.apache.cxf.transport.common.gzip.GZIPInInterceptor"/>
   <bean id="gzipOutInterceptor" class="org.apache.cxf.transport.common.gzip.GZIPOutInterceptor">
     <property name="threshold" value="0"/>
@@ -157,7 +154,6 @@ under the License.
     </jaxrs:inInterceptors>         
     <jaxrs:outInterceptors>
       <ref bean="gzipOutInterceptor"/>
-      <ref bean="validationOutInterceptor"/>
     </jaxrs:outInterceptors>
     <jaxrs:providers>
       <ref bean="dateParamConverterProvider"/>
diff --git a/ext/scimv2/scim-rest-cxf/src/main/resources/restSCIMv2CXFContext.xml b/ext/scimv2/scim-rest-cxf/src/main/resources/restSCIMv2CXFContext.xml
index cb306bf..b31029c 100644
--- a/ext/scimv2/scim-rest-cxf/src/main/resources/restSCIMv2CXFContext.xml
+++ b/ext/scimv2/scim-rest-cxf/src/main/resources/restSCIMv2CXFContext.xml
@@ -41,10 +41,7 @@ under the License.
   <bean id="validationInInterceptor" class="org.apache.cxf.jaxrs.validation.JAXRSBeanValidationInInterceptor">
     <property name="provider" ref="validationProvider"/>
   </bean>
-  <bean id="validationOutInterceptor" class="org.apache.cxf.jaxrs.validation.JAXRSBeanValidationOutInterceptor">
-    <property name="provider" ref="validationProvider"/>
-  </bean>   
-  
+
   <bean id="gzipInInterceptor" class="org.apache.cxf.transport.common.gzip.GZIPInInterceptor"/>
   <bean id="gzipOutInterceptor" class="org.apache.cxf.transport.common.gzip.GZIPOutInterceptor">
     <property name="threshold" value="0"/>
@@ -76,7 +73,6 @@ under the License.
     </jaxrs:inInterceptors>  
     <jaxrs:outInterceptors>
       <ref bean="gzipOutInterceptor"/>
-      <ref bean="validationOutInterceptor"/>
     </jaxrs:outInterceptors>
     <jaxrs:providers>
       <ref bean="jsonProvider"/>
diff --git a/fit/build-tools/pom.xml b/fit/build-tools/pom.xml
index 4fb23dc..72a447d 100644
--- a/fit/build-tools/pom.xml
+++ b/fit/build-tools/pom.xml
@@ -67,6 +67,11 @@ under the License.
     </dependency>
 
     <dependency>
+      <groupId>javax.xml.ws</groupId>
+      <artifactId>jaxws-api</artifactId>
+      <version>2.2.11</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.cxf</groupId>
       <artifactId>cxf-rt-frontend-jaxws</artifactId>
       <version>${cxf.version}</version>
diff --git a/fit/build-tools/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/fit/build-tools/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
index 8ad59c5..fce93ea 100644
--- a/fit/build-tools/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
+++ b/fit/build-tools/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
@@ -23,21 +23,23 @@ under the License.
       <subsystem name="webservices"/>
       <subsystem name="jaxrs"/>
       <subsystem name="jaxws"/>
+      <subsystem name="jsf"/>
     </exclude-subsystems>
     <dependencies>
       <module name="org.apache.xalan"/>
       <module name="org.reactivestreams"/>
+      <module name="javax.jws.api"/>
     </dependencies>
     <exclusions>
       <module name="javax.ws.soap.api"/>
       <module name="javax.ws.rs.api"/>
       <module name="org.apache.cxf"/>
       <module name="org.apache.cxf.impl"/>
-      <module name="org.hibernate"/>
       <module name="org.slf4j"/>
       <module name="org.slf4j.impl"/>
       <module name="org.apache.log4j"/>
       <module name="org.jboss.log4j.logmanager"/>
+      <module name="com.h2database.h2"/>
     </exclusions>
   </deployment>
 </jboss-deployment-structure>
diff --git a/fit/core-reference/pom.xml b/fit/core-reference/pom.xml
index 36f09fa..a36122d 100644
--- a/fit/core-reference/pom.xml
+++ b/fit/core-reference/pom.xml
@@ -1511,13 +1511,19 @@ under the License.
     </profile>
     
     <profile>
-      <id>glassfish-it</id>
-      
+      <id>payara-it</id>
+
       <dependencies>
         <dependency>
           <groupId>org.apache.syncope.core</groupId>
           <artifactId>syncope-core-persistence-jpa</artifactId>
           <version>${project.version}</version>
+          <exclusions>
+            <exclusion>
+              <groupId>org.apache.bval</groupId>
+              <artifactId>bval-jsr</artifactId>
+            </exclusion>
+          </exclusions>
         </dependency>
 
         <dependency>
@@ -1536,50 +1542,20 @@ under the License.
             <inherited>true</inherited>
             <configuration>
               <container>
-                <containerId>glassfish5x</containerId>
-                <zipUrlInstaller>
-                  <url>http://download.oracle.com/glassfish/5.0/release/glassfish-5.0.zip</url>
-                  <downloadDir>${settings.localRepository}/org/codehaus/cargo/cargo-container-archives</downloadDir>
-                  <extractDir>${project.build.directory}/cargo/extract</extractDir>
-                </zipUrlInstaller>
-                <log>${cargo.log}</log>
-                <output>${cargo.output}</output>
-              </container>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-
-    <profile>
-      <id>payara-it</id>
-
-      <dependencies>
-        <dependency>
-          <groupId>com.h2database</groupId>
-          <artifactId>h2</artifactId>
-        </dependency>
-      </dependencies>
-
-      <build>
-        <defaultGoal>clean verify</defaultGoal>
-
-        <plugins>
-          <plugin>
-            <groupId>org.codehaus.cargo</groupId>
-            <artifactId>cargo-maven2-plugin</artifactId>
-            <inherited>true</inherited>
-            <configuration>
-              <container>
                 <containerId>payara</containerId>
                 <zipUrlInstaller>
-                  <url>https://repo1.maven.org/maven2/fish/payara/distributions/payara/5.194/payara-5.194.zip</url>
+                  <url>https://repo1.maven.org/maven2/fish/payara/distributions/payara/5.201/payara-5.201.zip</url>
                   <downloadDir>${settings.localRepository}/org/codehaus/cargo/cargo-container-archives</downloadDir>
                   <extractDir>${project.build.directory}/cargo/extract</extractDir>
                 </zipUrlInstaller>
                 <log>${cargo.log}</log>
                 <output>${cargo.output}</output>
               </container>
+              <configuration>
+                <properties>
+                  <cargo.glassfish.removeDefaultDatasource>false</cargo.glassfish.removeDefaultDatasource>
+                </properties>
+              </configuration>
             </configuration>
           </plugin>
         </plugins>
diff --git a/fit/core-reference/src/main/resources/jboss/restCXFContext.xml b/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
index 044f926..250cfdc 100644
--- a/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
+++ b/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
@@ -78,10 +78,7 @@ under the License.
   <bean id="validationInInterceptor" class="org.apache.cxf.jaxrs.validation.JAXRSBeanValidationInInterceptor">
     <property name="provider" ref="validationProvider"/>
   </bean>
-  <bean id="validationOutInterceptor" class="org.apache.cxf.jaxrs.validation.JAXRSBeanValidationOutInterceptor">
-    <property name="provider" ref="validationProvider"/>
-  </bean>   
-  
+
   <bean id="gzipInInterceptor" class="org.apache.cxf.transport.common.gzip.GZIPInInterceptor"/>
   <bean id="gzipOutInterceptor" class="org.apache.cxf.transport.common.gzip.GZIPOutInterceptor">
     <property name="threshold" value="0"/>
@@ -171,7 +168,6 @@ under the License.
     </jaxrs:inInterceptors>         
     <jaxrs:outInterceptors>
       <ref bean="gzipOutInterceptor"/>
-      <ref bean="validationOutInterceptor"/>
     </jaxrs:outInterceptors>
     <jaxrs:providers>
       <ref bean="dateParamConverterProvider"/>
diff --git a/fit/core-reference/src/main/resources/log4j2.xml b/fit/core-reference/src/main/resources/log4j2.xml
index 8ad93bc..79178a3 100644
--- a/fit/core-reference/src/main/resources/log4j2.xml
+++ b/fit/core-reference/src/main/resources/log4j2.xml
@@ -184,7 +184,7 @@ under the License.
       <appender-ref ref="mainFile"/>
       <appender-ref ref="main"/>
     </asyncLogger>
-    <asyncLogger name="org.hibernate.validator" additivity="false" level="ERROR">
+    <asyncLogger name="org.apache.bval" additivity="false" level="ERROR">
       <appender-ref ref="mainFile"/>
       <appender-ref ref="main"/>
     </asyncLogger>
diff --git a/fit/core-reference/src/main/webapp/WEB-INF/glassfish-web.xml b/fit/core-reference/src/main/webapp/WEB-INF/glassfish-web.xml
index 2578cf5..2eea12b 100644
--- a/fit/core-reference/src/main/webapp/WEB-INF/glassfish-web.xml
+++ b/fit/core-reference/src/main/webapp/WEB-INF/glassfish-web.xml
@@ -27,7 +27,8 @@ GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/gla
     <jndi-name>jdbc/syncopeMasterDataSource</jndi-name>
   </resource-ref>-->
   <class-loader delegate="false"/>
+  <scanning-exclude>*</scanning-exclude>
   <jsp-config>
     <property name="httpMethods" value="GET,POST,HEAD,PUT,DELETE"/>
   </jsp-config>
-</glassfish-web-app>
\ No newline at end of file
+</glassfish-web-app>
diff --git a/fit/core-reference/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/fit/core-reference/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
index d3443a1..0dc8212 100644
--- a/fit/core-reference/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
+++ b/fit/core-reference/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
@@ -29,6 +29,8 @@ under the License.
       <module name="org.reactivestreams"/>
     </dependencies>
     <exclusions>
+      <module name="javax.mail.api"/>
+      <module name="javax.activation.api"/>
       <module name="javax.validation.api"/>
       <module name="org.hibernate.validator"/> 
       <module name="org.hibernate.validator.cdi"/>
diff --git a/pom.xml b/pom.xml
index be8838c..83de808 100644
--- a/pom.xml
+++ b/pom.xml
@@ -413,7 +413,7 @@ under the License.
 
     <openjpa.version>3.1.1</openjpa.version>
     <hikaricp.version>3.4.2</hikaricp.version>
-    <hibernate-validator.version>6.0.18.Final</hibernate-validator.version>
+    <bval.version>2.0.3</bval.version>
 
     <jasypt.version>1.9.3</jasypt.version>
 
@@ -849,14 +849,9 @@ under the License.
       </dependency>
 
       <dependency>
-        <groupId>org.hibernate.validator</groupId>
-        <artifactId>hibernate-validator</artifactId>
-        <version>${hibernate-validator.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.glassfish</groupId>
-        <artifactId>javax.el</artifactId>
-        <version>3.0.1-b09</version>
+        <groupId>org.apache.bval</groupId>
+        <artifactId>bval-jsr</artifactId>
+        <version>${bval.version}</version>
       </dependency>
             
       <dependency>
diff --git a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/javaeecontainer.adoc b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/javaeecontainer.adoc
index 7099ba2..a5c2feb 100644
--- a/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/javaeecontainer.adoc
+++ b/src/main/asciidoc/reference-guide/workingwithapachesyncope/systemadministration/javaeecontainer.adoc
@@ -60,6 +60,34 @@ Be sure to put the corresponding JDBC driver JAR file under `$CATALINA_HOME/lib`
 
 ===== Payara Server 5
 
+Replace
+
+[source,xml]
+....
+    <dependency>
+      <groupId>org.apache.syncope.core</groupId>
+      <artifactId>syncope-core-persistence-jpa</artifactId>
+    </dependency>
+....
+
+with
+
+[source,xml]
+....
+    <dependency>
+      <groupId>org.apache.syncope.core</groupId>
+      <artifactId>syncope-core-persistence-jpa</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.bval</groupId>
+          <artifactId>bval-jsr</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+....
+
+in `core/pom.xml`.
+
 When using a datasource for internal storage, be sure to add
 
 [source,xml]
@@ -70,8 +98,8 @@ When using a datasource for internal storage, be sure to add
 </resource-ref>
 ....
 
-right after `</context-root>` in `core/src/main/webapp/WEB-INF/glassfish-web.xml`, assuming that your Payara Server instance
-provides a datasource named `jdbc/syncopeMasterDataSource`.
+right after `</context-root>` in `core/src/main/webapp/WEB-INF/glassfish-web.xml`, assuming that your Payara Server
+instance provides a datasource named `jdbc/syncopeMasterDataSource`.
 
 [TIP]
 ====
diff --git a/src/site/xdoc/building.xml b/src/site/xdoc/building.xml
index fdcde59..e566b06 100644
--- a/src/site/xdoc/building.xml
+++ b/src/site/xdoc/building.xml
@@ -186,11 +186,6 @@ under the License.
 
         <h4>Java EE containers</h4>
 
-        <h5>Glassfish</h5>
-        Perform the full test suite by deploying Syncope core in 
-        <a href="https://glassfish.java.net/">Glassfish</a> via
-        <source>$ mvn -Pglassfish-it</source>
-
         <h5>Payara</h5>
         Perform the full test suite by deploying Syncope core in 
         <a href="http://www.payara.fish/">Payara</a> via