<?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>org.opensaml</groupId>
        <artifactId>opensaml-parent</artifactId>
        <version>5.2.1</version>
    </parent>

    <name>OpenSAML :: Storage Implementation</name>
    <description>Storage Implementation</description>
    <artifactId>opensaml-storage-impl</artifactId>
    <packaging>jar</packaging>

    <properties>
        <automatic.module.name>org.opensaml.storage.impl</automatic.module.name>
    </properties>

    <dependencies>
        <!-- Compile Dependencies -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>opensaml-messaging-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>opensaml-profile-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>opensaml-storage-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>${shib-shared.groupId}</groupId>
            <artifactId>shib-security</artifactId>
        </dependency>

        <dependency>
            <groupId>${shib-shared.groupId}</groupId>
            <artifactId>shib-networking</artifactId>
        </dependency>

        <dependency>
        	<groupId>com.google.guava</groupId>
        	<artifactId>guava</artifactId>
        </dependency>

        <!-- Needed for Memcache storage plugin. -->
        <dependency>
            <groupId>net.spy</groupId>
            <artifactId>spymemcached</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.cryptacular</groupId>
            <artifactId>cryptacular</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
        </dependency>

        <!-- Provided Dependencies -->
        <dependency>
            <groupId>jakarta.json</groupId>
            <artifactId>jakarta.json-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Runtime Dependencies -->
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>jakarta.json</artifactId>
            <scope>runtime</scope>
        </dependency>
        
        <!-- Test Dependencies -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>opensaml-testing</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>${shib-shared.groupId}</groupId>
            <artifactId>shib-testing</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Uncomment for local testing with specific databases. -->
        <!--
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.2.10.jre7</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.19</version>
            <scope>test</scope>
        </dependency>
        -->

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

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

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

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludedGroups>${excluded.test.groups}</excludedGroups>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!--
          Use a profile-based system to exclude tests that need external test fixtures to run
          (e.g. org.opensaml.storage.impl.memcached.MemcachedStorageServiceTest).
          Those tests are executed only under explicit profile activation, e.g. mvn -Pall clean package.
        -->
        <profile>
            <id>default</id>
            <activation><activeByDefault>true</activeByDefault></activation>
            <properties>
                <excluded.test.groups>needs-external-fixture</excluded.test.groups>
            </properties>
        </profile>
        <profile>
            <id>all</id>
            <properties>
                <excluded.test.groups/>
            </properties>
        </profile>
    </profiles>

</project>
