<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Hibernate Validator, declare and validate application constraints
  ~
  ~ License: Apache License, Version 2.0
  ~ See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
  -->
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>hibernate-validator-parent</artifactId>
        <groupId>org.hibernate</groupId>
        <version>5.3.3.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>hibernate-validator</artifactId>

    <name>Hibernate Validator Engine</name>
    <description>Hibernate's Bean Validation (JSR-303) reference implementation.</description>

    <distributionManagement>
        <site>
            <id>site</id>
            <url>http://hibernate.org/validator</url>
        </site>
    </distributionManagement>

    <dependencies>
        <!--
        Compile time dependencies
        -->
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml</groupId>
            <artifactId>classmate</artifactId>
        </dependency>

        <!--
        Provided dependencies
        -->
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>javax.el-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>javax.el</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging-processor</artifactId>
            <!--
            HV-963
            This is actually not a dependency which is needed at runtime, however,
            Maven does not have a compile time only scope. The dependency is needed to
            run the JBoss Logging annotation processor as part of the main compilation.
            Trying different setups via compiler plugin local dependencies or extensions
            all fail. See also http://stackoverflow.com/questions/14322904/maven-3-how-to-add-annotation-processor-dependency
            -->
            <scope>provided</scope>
        </dependency>

        <!--
        Optional dependencies
        -->
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.thoughtworks.paranamer</groupId>
            <artifactId>paranamer</artifactId>
            <optional>true</optional>
        </dependency>

        <!--
        Test dependencies
        -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator-test-utils</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-jsr223</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easytesting</groupId>
            <artifactId>fest-assert</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <defaultGoal>test</defaultGoal>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/main/xsd</directory>
                <targetPath>META-INF</targetPath>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <filtering>true</filtering>
                <directory>src/test/resources</directory>
                <includes>
                    <include>META-INF/services/*</include>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <archive>
                                <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                                <manifestEntries>
                                    <Specification-Title>Bean Validation</Specification-Title>
                                    <Specification-Version>1.1</Specification-Version>
                                </manifestEntries>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Import-Package>
                            javax.persistence.*;version="[2.0.0,3.0.0)";resolution:=optional,
                            javax.validation.*;version="[1.0.0,2.0.0)",
                            javax.xml.*;version="0",
                            javax.el.*;version="[2.0.0,4.0.0)";resolution:=optional,
                            org.xml.sax.*;version="0",
                            org.jboss.logging.*;version="[3.1.0,4.0.0)",
                            com.fasterxml.classmate.*;version="[${classmate.version},2.0.0)",
                            org.joda.time.*;version="[2.0.0,3.0.0)";resolution:=optional,
                            org.jsoup.*;version="[1.5.2,2.0.0)";resolution:=optional,
                            com.thoughtworks.paranamer.*;version="[2.5.5,3.0.0)";resolution:=optional
                        </Import-Package>
                        <Export-Package>
                            org.hibernate.validator;version="${project.version}",
                            org.hibernate.validator.cfg.*;version="${project.version}",
                            org.hibernate.validator.constraints.*;version="${project.version}",
                            org.hibernate.validator.constraintvalidation.*;version="${project.version}",
                            org.hibernate.validator.constraintvalidators.*;version="${project.version}",
                            org.hibernate.validator.group;version="${project.version}",
                            org.hibernate.validator.messageinterpolation;version="${project.version}",
                            org.hibernate.validator.parameternameprovider;version="${project.version}",
                            org.hibernate.validator.path;version="${project.version}",
                            org.hibernate.validator.resourceloading;version="${project.version}",
                            org.hibernate.validator.spi.*;version="${project.version}",
                            org.hibernate.validator.valuehandling;version="${project.version}",
                        </Export-Package>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <parallel>tests</parallel>
                    <threadCount>4</threadCount>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.github.siom79.japicmp</groupId>
                <artifactId>japicmp-maven-plugin</artifactId>
                <configuration>
                    <skip>false</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>pre-jdk9</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>jaxb2-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>xjc</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <packageName>org.hibernate.validator.internal.xml</packageName>
                            <extension>true</extension>
                            <!-- Generate correct getters for Boolean properties -->
                            <enableIntrospection>true</enableIntrospection>
                            <!-- Makes sure the generated code is compatible with JAXB 2.1 which is what comes with Java 1.6 -->
                            <target>2.1</target>
                            <sources>
                                <source>src/main/xsd/validation-configuration-1.1.xsd</source>
                                <source>src/main/xsd/validation-mapping-1.1.xsd</source>
                            </sources>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk9</id>
            <activation>
                <jdk>9</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <tasks>
                                        <echo message="Creating target/generated-sources/jaxb"/>
                                        <mkdir dir="./target/generated-sources/jaxb"/>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>generate schema types</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <executable>xjc</executable>
                            <arguments>
                                <argument>-enableIntrospection</argument>
                                <argument>-p</argument>
                                <argument>org.hibernate.validator.internal.xml</argument>
                                <argument>-extension</argument>
                                <argument>-target</argument>
                                <argument>2.1</argument>
                                <argument>-d</argument>
                                <argument>target/generated-sources/jaxb</argument>
                                <argument>src/main/xsd/validation-configuration-1.1.xsd</argument>
                                <argument>src/main/xsd/validation-mapping-1.1.xsd</argument>
                                <argument>-b</argument>
                                <argument>src/main/xjb/binding-customization.xjb</argument>
                            </arguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>target/generated-sources/jaxb</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
