<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.github.choonchernlim</groupId>
        <artifactId>spring-boot-ci</artifactId>
        <version>0.4.0</version>
        <relativePath/>
    </parent>

    <artifactId>spring-security-adfs-saml2</artifactId>
    <version>0.9.0</version>
    <packaging>jar</packaging>

    <name>Spring Security ADFS SAML2</name>
    <description>Spring Security ADFS module using SAML2 protocol</description>
    <url>https://github.com/choonchernlim/spring-security-adfs-saml2</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>choonchernlim</id>
            <name>Choon-Chern Lim</name>
            <email>choonchernlim@gmail.com</email>
            <url>https://github.com/choonchernlim</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:choonchernlim/spring-security-adfs-saml2.git</connection>
        <developerConnection>scm:git:git@github.com:choonchernlim/spring-security-adfs-saml2.git</developerConnection>
        <url>git@github.com:choonchernlim/spring-security-adfs-saml2.git</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <jdk.version>1.8</jdk.version>

        <better-preconditions.version>0.1.1</better-preconditions.version>
        <opensaml.version>2.6.4</opensaml.version>
        <javaee-api.version>8.0</javaee-api.version>
        <pojobuilder.version>4.2.2</pojobuilder.version>
        <objenesis.version>3.0.1</objenesis.version>
        <spring-security-saml2.version>1.0.3.RELEASE</spring-security-saml2.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>javax</groupId>
                <artifactId>javaee-api</artifactId>
                <version>${javaee-api.version}</version>
            </dependency>
            <dependency>
                <groupId>net.karneim</groupId>
                <artifactId>pojobuilder</artifactId>
                <version>${pojobuilder.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.security.extensions</groupId>
                <artifactId>spring-security-saml2-core</artifactId>
                <version>${spring-security-saml2.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>xml-apis</groupId>
                        <artifactId>xml-apis</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.opensaml</groupId>
                <artifactId>opensaml</artifactId>
                <version>${opensaml.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.choonchernlim</groupId>
                <artifactId>better-preconditions</artifactId>
                <version>${better-preconditions.version}</version>
            </dependency>
            <dependency>
                <groupId>org.objenesis</groupId>
                <artifactId>objenesis</artifactId>
                <version>${objenesis.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Scope: Provided -->
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.karneim</groupId>
            <artifactId>pojobuilder</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Scope: Compile -->
        <dependency>
            <groupId>org.springframework.security.extensions</groupId>
            <artifactId>spring-security-saml2-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opensaml</groupId>
            <artifactId>opensaml</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.choonchernlim</groupId>
            <artifactId>better-preconditions</artifactId>
        </dependency>

        <!-- Scope: Test -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-spring</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.objenesis</groupId>
            <artifactId>objenesis</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!--
            When using `mkarneim/pojobuilder` (https://github.com/mkarneim/pojobuilder), the builder source files
            are generated at `target/generated-sources/annotations`. If these source files exist and `mvn compile`
            is issued, the following exception occurs: "The type *Builder is already defined". This forces us to
            always do `mvn clean` to wipe out `target` first before running any command.
            To fix this, always clean up these source files after it is compiled.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target name="Deleting all source files created by Pojo Builder">
                                <delete failonerror="false">
                                    <fileset dir="${project.build.directory}/generated-sources/annotations"
                                             includes="**/*Builder.java"/>
                                </delete>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>