<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>net.shibboleth</groupId>
        <artifactId>parent</artifactId>
        <version>17.2.1</version>
    </parent>

    <name>Shibboleth Metadata Aggregator</name>
    <description>
        A framework and tool for processing metadata, with an emphasis on SAML metadata.
    </description>


    <groupId>net.shibboleth.metadata</groupId>
    <artifactId>mda-parent</artifactId>
    <version>1.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>

    <modules>
        <module>mda-keylists-rsa</module>
        <module>mda-keylists-rsa-legacy</module>
        <module>mda-framework</module>
        <module>mda-cli</module>
        <module>mda-distribution</module>
    </modules>

    <properties>
        <shib-shared.groupId>net.shibboleth</shib-shared.groupId>
        <shib-shared.version>9.2.1</shib-shared.version>
        <shibboleth.projectName>java-metadata-aggregator</shibboleth.projectName>
        <checkstyle.configLocation>${project.basedir}/resources/checkstyle/checkstyle.xml</checkstyle.configLocation>
    </properties>

    <!-- Dependencies which are not required by every project module but for which every module should use the same version
        of the dependency should go here. That is to say, placing a dependency here allows one to "peg" the version of the artifact
        used by all project modules. -->
    <dependencyManagement>
        <dependencies>

            <!-- Compile Dependencies -->

            <dependency>
                <groupId>${shib-shared.groupId}</groupId>
                <artifactId>shib-networking</artifactId>
                <version>${shib-shared.version}</version>
            </dependency>
            <dependency>
                <groupId>${shib-shared.groupId}</groupId>
                <artifactId>shib-networking-spring</artifactId>
                <version>${shib-shared.version}</version>
            </dependency>
            <dependency>
                <groupId>${shib-shared.groupId}</groupId>
                <artifactId>shib-security</artifactId>
                <version>${shib-shared.version}</version>
            </dependency>
            <dependency>
                <groupId>${shib-shared.groupId}</groupId>
                <artifactId>shib-security-spring</artifactId>
                <version>${shib-shared.version}</version>
            </dependency>
            <dependency>
                <groupId>${shib-shared.groupId}</groupId>
                <artifactId>shib-spring</artifactId>
                <version>${shib-shared.version}</version>
            </dependency>
            <dependency>
                <groupId>${shib-shared.groupId}</groupId>
                <artifactId>shib-support</artifactId>
                <version>${shib-shared.version}</version>
            </dependency>

            <!-- Provided Dependencies -->

            <!-- Runtime Dependencies -->

            <!-- Test Dependencies -->

        </dependencies>
    </dependencyManagement>

    <build>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>4.7.1.1</version>
                    <dependencies>
                        <!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
                        <!--
                        <dependency>
                            <groupId>com.github.spotbugs</groupId>
                            <artifactId>spotbugs</artifactId>
                            <version>4.7.1</version>
                        </dependency>
                        -->
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>

            <!--
                Configuration for spotbugs:* goals called directly
                from the command line.

                Note that SpotBugs is not part of the normal build, by default.
            -->
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <configuration>
                    <excludeFilterFile>${project.basedir}/../resources/spotbugs/spotbugs-exclude.xml</excludeFilterFile>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Automatic-Module-Name>${automatic.module.name}</Automatic-Module-Name>
                            <Sealed>true</Sealed>
                        </manifestEntries>
                    </archive>
                </configuration>
             </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>banned-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <!--
                                            Ensure that we're not either directly or indirectly making use of the
                                            joda-time package. Our time handling should be exclusively based on the
                                            java.time package introduced in Java 8.
                                        -->
                                        <exclude>joda-time:joda-time</exclude>
                                        <!--
                                            Ban use of older coordinates for Bouncy Castle components.
                                        -->
                                        <exclude>org.bouncycastle:*-jdk15on</exclude>
                                    </excludes>
                                    <includes>
                                        <!--
                                            joda-time may still be used in tests.
                                        -->
                                        <exclude>joda-time:joda-time:*:jar:test</exclude>
                                    </includes>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
