<?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 ">

    <modelVersion>4.0.0</modelVersion>
    <groupId>au.org.ala</groupId>
    <artifactId>jasig-cas-4.0.x-overlay-template</artifactId>
    <packaging>war</packaging>
    <version>1.0</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <warName>cas</warName>
                    <overlays>
                        <overlay>
                            <groupId>org.jasig.cas</groupId>
                            <artifactId>cas-server-webapp</artifactId>
			    <excludes>
				<exclude>WEB-INF/cas.properties</exclude>
				<exclude>WEB-INF/classes/log4j.xml</exclude>
			    </excludes>
                        </overlay>
                    </overlays>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
            </plugin>

        </plugins>
        <finalName>cas</finalName>
    </build>

    <dependencies>
	<!-- NOTE: review the use of ala-headers-and-tails, currently this is needed ONLY? to include javax.servlet API: changed to use the javax.servlet API directly -->
	<dependency>
	    <groupId>javax.servlet</groupId>
	    <artifactId>javax.servlet-api</artifactId>
	    <version>3.0.1</version>
	    <scope>provided</scope>
	</dependency>
	<dependency>
            <groupId>org.jasig.cas</groupId>
            <artifactId>cas-server-webapp</artifactId>
            <version>${cas.version}</version>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>
	<!-- TODO: cas-server-webapp-support BUG workaround
	     - https://issues.jasig.org/browse/CAS-1380
	     - https://github.com/Jasig/cas/pull/382
	     the old spring dependencies are required to workaround the bug without them cas-server-webapp-support
	     throws an exception on cas.war deploy and won't start.
	-->
	<dependency>
	    <groupId>org.jasig.cas</groupId>
	    <artifactId>cas-server-webapp-support</artifactId>
	    <version>${cas.version}</version>
	    <type>jar</type>
	</dependency>
	<dependency>
	    <groupId>org.springframework</groupId>
	    <artifactId>spring-web</artifactId>
	    <version>3.2.2.RELEASE</version>
	</dependency>
	
	<dependency>
	    <groupId>org.jasig.cas</groupId>
	    <artifactId>cas-server-support-jdbc</artifactId>
	    <version>${cas.version}</version>
	    <type>jar</type>
	</dependency>
	<dependency>
	    <groupId>com.mchange</groupId>
	    <artifactId>c3p0</artifactId>
	    <version>0.9.5.1</version>
	</dependency>
	<dependency>
	    <groupId>mysql</groupId>
	    <artifactId>mysql-connector-java</artifactId>
	    <version>5.1.35</version>
	    <scope>runtime</scope>
	</dependency>
	<!-- TODO: review the use of commons-codec, newer jre version might support base64, no need for an external lib? -->
	<dependency>
	    <groupId>commons-codec</groupId>
	    <artifactId>commons-codec</artifactId>
	    <version>1.10</version>
	    <type>jar</type>
	    <scope>compile</scope>
	</dependency>
	<!-- NOTE: older version of JSON.org is used because the newer version 20141113 was throwing
	     Throwable: "Exception:org/json/JSONArray : Unsupported major.minor version 52.0 (unable to load class org.json.JSONArray)"
	     (or we can build our own from https://github.com/douglascrockford/JSON-java and upload it into ALA maven repo)
	-->
	<dependency>
	    <groupId>org.json</groupId>
	    <artifactId>json</artifactId>
	    <version>20140107</version>
	    <type>jar</type>
	</dependency>
	<!-- TODO: review the use of saml in source code and (most likely REMOVE this dependency) -->
	<dependency>
	    <groupId>org.jasig.cas</groupId>
	    <artifactId>cas-server-support-saml</artifactId>
	    <version>${cas.version}</version>
	    <type>jar</type>
	</dependency>

	<dependency>
	    <groupId>org.jasig.cas</groupId>
	    <artifactId>cas-server-core</artifactId>
	    <version>${cas.version}</version>
	    <type>test-jar</type>
	</dependency>

	<dependency>
	    <groupId>org.jasig.cas</groupId>
	    <artifactId>cas-server-support-generic</artifactId>
	    <version>${cas.version}</version>
	    <type>jar</type>
	    <scope>runtime</scope>
	</dependency>
	<dependency>
	    <groupId>org.jasig.cas</groupId>
	    <artifactId>cas-server-integration-restlet</artifactId>
	    <version>${cas.version}</version>
	    <type>jar</type>
	</dependency>

	<!-- TODO: verify which pac4j modules we really need -->
	<dependency>
	    <groupId>org.jasig.cas</groupId>
	    <artifactId>cas-server-support-pac4j</artifactId>
	    <version>${cas.version}</version>
	</dependency>
	<dependency>
	    <groupId>org.pac4j</groupId>
	    <artifactId>pac4j-core</artifactId>
	    <version>${pac4j.version}</version>
	</dependency>
	<dependency>
	    <groupId>org.pac4j</groupId>
	    <artifactId>pac4j-oauth</artifactId>
	    <version>${pac4j.version}</version>
	</dependency>
	<dependency>
	    <groupId>org.pac4j</groupId>
	    <artifactId>pac4j-openid</artifactId>
	    <version>${pac4j.version}</version>
	</dependency>

    </dependencies>

    <properties>
        <cas.version>4.0.2</cas.version>
	<pac4j.version>1.4.2-SNAPSHOT</pac4j.version>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <repositories>
        <repository>
            <id>sonatype-releases</id>
            <url>http://oss.sonatype.org/content/repositories/releases/</url>
        </repository>
        <repository>
            <id>sonatype-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </repository>
	<repository>
	    <id>jasig-developer-repo</id>
	    <name>Jasig developer repository</name>
	    <url>http://developer.jasig.org/repo/content/groups/m2-legacy/</url>
	    <releases>
		<enabled>true</enabled>
	    </releases>
	    <snapshots>
		<enabled>false</enabled>
	    </snapshots>
	</repository>
    </repositories>

    <distributionManagement>
	<repository>
	    <id>ala-repo</id>
	    <name>Internal Releases</name>
	    <url>http://nexus.ala.org.au/content/repositories/releases/</url>
	</repository>
	<snapshotRepository>
	    <id>ala-repo</id>
	    <name>Internal Releases</name>
	    <url>http://nexus.ala.org.au/content/repositories/snapshots/</url>
	</snapshotRepository>
    </distributionManagement>

</project>
