<?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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>net.shibboleth</groupId>
        <artifactId>parent-v3</artifactId>
        <version>10</version>
    </parent>

    <name>idp-jetty-base</name>
    <groupId>net.shibboleth.idp</groupId>
    <artifactId>idp-jetty-base</artifactId>
    <packaging>pom</packaging>
    <version>9.3.0</version>

    <properties>
        <jetty9-dta-ssl.version>1.0.0</jetty9-dta-ssl.version>
        <assemblyDirectory>${project.build.directory}/idp-jetty-base</assemblyDirectory>
    </properties>

    <repositories>
        <repository>
            <id>shib-release</id>
            <url>https://build.shibboleth.net/nexus/content/groups/public</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>shib-snapshot</id>
            <url>https://build.shibboleth.net/nexus/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>

    <dependencies>
        <!-- Compile Dependencies -->

        <!-- Provided Dependencies -->

        <!-- Runtime Dependencies -->
        <!-- Our Jetty 9 DTA plugin -->
        <dependency>
            <groupId>net.shibboleth.utilities.jetty9</groupId>
            <artifactId>jetty9-dta-ssl</artifactId>
            <version>${jetty9-dta-ssl.version}</version>
            <optional>true</optional>
            <scope>runtime</scope>
        </dependency>
        <!-- Logging dependencies. https://issues.shibboleth.net/jira/browse/JPAR-57 -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>${slf4j.groupId}</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!-- Test Dependencies -->

        <!-- Managed Dependencies -->
    </dependencies>

    <build>
        <plugins>
            <!-- Copy src/main/resources to assembly directory. -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <includeEmptyDirs>true</includeEmptyDirs>
                            <outputDirectory>${assemblyDirectory}</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${basedir}/src/main/resources</directory>
                                    <excludes>
                                        <exclude>**/.gitkeep</exclude>
                                    </excludes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <!-- Copy Jetty DTA plugin to jetty-base/lib/ext/ directory. -->
                    <execution>
                        <id>copy-jetty-dta-ssl</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>net.shibboleth.utilities.jetty9</groupId>
                                    <artifactId>jetty9-dta-ssl</artifactId>
                                    <version>${jetty9-dta-ssl.version}</version>
                                    <type>jar</type>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${assemblyDirectory}/jetty-base/lib/ext</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                    <!-- Copy logging dependencies to jetty-base/lib/logging/ directory. -->
                    <execution>
                        <id>copy-jetty-logging-dependencies</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>ch.qos.logback</groupId>
                                    <artifactId>logback-classic</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>ch.qos.logback</groupId>
                                    <artifactId>logback-core</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>ch.qos.logback</groupId>
                                    <artifactId>logback-access</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>${slf4j.groupId}</groupId>
                                    <artifactId>jcl-over-slf4j</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>${slf4j.groupId}</groupId>
                                    <artifactId>slf4j-api</artifactId>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${assemblyDirectory}/jetty-base/lib/logging/</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>src/main/assembly/tgz.xml</descriptor>
                        <descriptor>src/main/assembly/zip.xml</descriptor>
                    </descriptors>
                    <tarLongFileMode>gnu</tarLongFileMode>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
