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

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

    <groupId>net.shibboleth.ext</groupId>
    <artifactId>spring-extensions</artifactId>
    <!-- If you change the version you *MUST* provoke a jenkins 'site'
         build (to populate the javadoc, which is consumed by the
         Jenkins 'nightly' builds).
    -->
    <version>6.3.2</version>

    <name>Spring Framework Extension</name>
    <description>
        A set of extensions for the Spring framework.  This package includes things like
        factory beans, converters, etc.
    </description>

    <properties>
        <shibboleth.projectName>spring-extensions</shibboleth.projectName>
        <automatic.module.name>net.shibboleth.ext.spring</automatic.module.name>
        <java-support.version>8.4.2</java-support.version>
        <jdk.version>15.3</jdk.version>
    </properties>

    <dependencies>
        <!-- Compile dependencies -->
        <dependency>
            <groupId>${slf4j.groupId}</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <!-- Required for HTTPResource. -->
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        <dependency>
            <!-- Required if you're using anything in the httpclient package -->
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient-cache</artifactId>
        </dependency>

        <dependency>
            <groupId>org.cryptacular</groupId>
            <artifactId>cryptacular</artifactId>
            <!-- Required for any classes that deals with cryptographic artifacts (keys, certs, algorithms, etc.) -->
            <optional>true</optional>
        </dependency>
        <!-- Override temporarily. -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk18on</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>net.shibboleth.utilities</groupId>
            <artifactId>java-support</artifactId>
            <version>${java-support.version}</version>
            <!-- Required for the DomDocumentFactoryBean and Duration conversion classes. -->
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.beust</groupId>
            <artifactId>jcommander</artifactId>
            <!-- Required for command line classes. -->
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>${spring.groupId}</groupId>
            <artifactId>spring-context</artifactId>
            <!-- Required for ApplicationContext classes. -->
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>${spring.groupId}</groupId>
            <artifactId>spring-core</artifactId>
            <!-- Required for Duration conversion classes. -->
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>${spring.groupId}</groupId>
            <artifactId>spring-beans</artifactId>
            <!-- Required for factory classes. -->
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>${spring.groupId}</groupId>
            <artifactId>spring-webmvc</artifactId>
            <!-- Required for error handling classes. -->
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-engine-core</artifactId>
            <!-- Required if you're using classes from the velocity package -->
            <optional>true</optional>
        </dependency>

        <!-- Provided dependencies -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
            <!-- Required for error handling classes. -->
            <optional>true</optional>
        </dependency>

        <!-- Runtime dependencies -->

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>${spring.groupId}</groupId>
          <artifactId>spring-test</artifactId>
          <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>net.shibboleth.utilities</groupId>
            <artifactId>java-support</artifactId>
            <version>${java-support.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

    </dependencies>

        <profiles>
        <!--
            Pull in a Javascript engine for testing in Java
            versions where the JDK doesn't provide one.
        -->
        <profile>
            <id>get-nashorn</id>
            <activation>
                <jdk>[15,</jdk>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.openjdk.nashorn</groupId>
                    <artifactId>nashorn-core</artifactId>
                    <version>${nashorn.jdk.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>


    <build>
        <plugins>
            <plugin>
                <groupId>net.shibboleth.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <links combine.children="append">
                        <link>${javadoc.url}/java-support/${java-support.version}</link>
                    </links>
                </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>
        </plugins>
    </build>

</project>
