hibernate-validator-modules
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-modules</artifactId>
<version>5.4.3.Final</version>
</dependency><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>hibernate-validator-parent</artifactId>
<groupId>org.hibernate</groupId>
<version>5.4.3.Final</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hibernate-validator-modules</artifactId>
<packaging>pom</packaging>
<name>Hibernate Validator WildFly Module</name>
<description>Hibernate Validator modules creation to use in WildFly</description>
<properties>
<module.xml.targetdir>${project.build.directory}/modules</module.xml.targetdir>
<hibernate.validator.module.slot>main</hibernate.validator.module.slot>
<hibernate.validator.cdi.module.slot>main</hibernate.validator.cdi.module.slot>
<javax.validation.api.module.slot>main</javax.validation.api.module.slot>
<wildflyOriginalTargetDir>${project.build.directory}/wildfly-original/wildfly-${wildfly.version}</wildflyOriginalTargetDir>
<wildflyPatchedTargetDir>${project.build.directory}/wildfly-patched/wildfly-${wildfly.version}</wildflyPatchedTargetDir>
<patchFile>${project.build.directory}/hv-patch.zip</patchFile>
<patch-gen-maven-plugin.argLine.add-opens></patch-gen-maven-plugin.argLine.add-opens>
</properties>
<dependencyManagement/>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-cdi</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>modules</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/modules</directory>
<filtering>true</filtering>
</resource>
</resources>
<outputDirectory>${module.xml.targetdir}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<!-- This defines the properties 'parsedVersion.majorVersion'
and 'parsedVersion.minorVersion' to be in synch with the current project version -->
<execution>
<id>parse-project-version</id>
<goals>
<goal>parse-version</goal>
</goals>
</execution>
<!-- attach the created patch file to the build so it gets installed and deployed -->
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${patchFile}</file>
<type>zip</type>
<classifier>wildfly-${wildfly.version}-patch</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<!-- Extract WildFly twice: one copy to be left as is, the other to be updated with the new JARs -->
<execution>
<id>unpack-wildfly</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-dist</artifactId>
<version>${wildfly.version}</version>
<type>tar.gz</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/wildfly-original</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-dist</artifactId>
<version>${wildfly.version}</version>
<type>tar.gz</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/wildfly-patched</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<!-- Update the BV/HV JARs in the second WF copy -->
<execution>
<id>prepare-patch-jars</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${bv.api.version}</version>
<overWrite>false</overWrite>
<outputDirectory>${wildflyPatchedTargetDir}/modules/system/layers/base/javax/validation/api/main</outputDirectory>
<!-- Specifying name to avoid timestamp in version on CI -->
<destFileName>validation-api-${bv.api.version}.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${project.version}</version>
<overWrite>false</overWrite>
<outputDirectory>${wildflyPatchedTargetDir}/modules/system/layers/base/org/hibernate/validator/main</outputDirectory>
<destFileName>hibernate-validator-${project.version}.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>hibernate-validator-cdi</artifactId>
<version>${project.version}</version>
<overWrite>false</overWrite>
<outputDirectory>${wildflyPatchedTargetDir}/modules/system/layers/base/org/hibernate/validator/cdi/main</outputDirectory>
<destFileName>hibernate-validator-cdi-${project.version}.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- Update module.xml descriptors in the second WF copy -->
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
<id>update-modules</id>
<phase>prepare-package</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<scripts>
<script>file:///${pom.basedir}/src/script/setupModules.groovy</script>
</scripts>
</configuration>
</execution>
</executions>
</plugin>
<!-- Create the patch file, based on the diff of the original WF and the updated one -->
<plugin>
<groupId>org.jboss.as</groupId>
<artifactId>patch-gen-maven-plugin</artifactId>
<executions>
<execution>
<id>create-patch-file</id>
<phase>prepare-package</phase>
<goals>
<goal>generate-patch</goal>
</goals>
<configuration>
<argLine>${patch-gen-maven-plugin.argLine.add-opens}</argLine>
<appliesToDist>${wildflyOriginalTargetDir}</appliesToDist>
<patchConfig>${module.xml.targetdir}/patch.xml</patchConfig>
<updatedDist>${wildflyPatchedTargetDir}</updatedDist>
<outputFile>${patchFile}</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>jdk9</id>
<activation>
<jdk>9</jdk>
</activation>
<properties>
<patch-gen-maven-plugin.argLine.add-opens>--add-opens=java.base/java.lang=ALL-UNNAMED</patch-gen-maven-plugin.argLine.add-opens>
</properties>
</profile>
</profiles>
</project>