<?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</artifactId>
        <version>17.1.4</version>
    </parent>

    <groupId>net.shibboleth.tool</groupId>
    <artifactId>xmlsectool</artifactId>
    <version>4.0.0</version>
    <packaging>jar</packaging>

    <name>XMLSecTool</name>
    <description>
        A command line tool for checking an XML file for well-formedness and validity as well as
        signing and checking signatures.
    </description>
    <inceptionYear>2011</inceptionYear>

    <properties>
        <opensaml.groupId>org.opensaml</opensaml.groupId>
        <opensaml.version>5.1.4</opensaml.version>
        <shib-shared.groupId>net.shibboleth</shib-shared.groupId>
        <shib-shared.version>9.1.4</shib-shared.version>
        <dependenciesDirectory>${project.build.directory}/dependencies</dependenciesDirectory>
    </properties>

    <dependencies>
        <!-- Compile dependencies -->
        <dependency>
            <groupId>${slf4j.groupId}</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <dependency>
            <groupId>${shib-shared.groupId}</groupId>
            <artifactId>shib-networking</artifactId>
            <version>${shib-shared.version}</version>
        </dependency>
        <dependency>
            <groupId>${shib-shared.groupId}</groupId>
            <artifactId>shib-support</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>${opensaml.groupId}</groupId>
            <artifactId>opensaml-core-api</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>${opensaml.groupId}</groupId>
            <artifactId>opensaml-core-impl</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>${opensaml.groupId}</groupId>
            <artifactId>opensaml-security-api</artifactId>
            <version>${opensaml.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>${spring.groupId}</groupId>
                    <artifactId>spring-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>${opensaml.groupId}</groupId>
            <artifactId>opensaml-xmlsec-api</artifactId>
            <version>${opensaml.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.santuario</groupId>
            <artifactId>xmlsec</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.woodstox</groupId>
                    <artifactId>woodstox-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk18on</artifactId>
        </dependency>
        <dependency>
            <groupId>com.beust</groupId>
            <artifactId>jcommander</artifactId>
        </dependency>
        <dependency>
            <groupId>${httpclient.groupId}</groupId>
            <artifactId>${httpclient.artifactId}</artifactId>
        </dependency>
        <dependency>
            <groupId>${httpclient.httpcore.groupId}</groupId>
            <artifactId>${httpclient.httpcore.artifactId}</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
        </dependency>

        <!-- Runtime dependencies -->
        <dependency>
            <groupId>${opensaml.groupId}</groupId>
            <artifactId>opensaml-xmlsec-impl</artifactId>
            <version>${opensaml.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>${slf4j.groupId}</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <scope>runtime</scope>
        </dependency>

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

    <build>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifestEntries>
                            <Main-Class>net.shibboleth.tool.xmlsectool.Version</Main-Class>
                        </manifestEntries>
                        <manifestSections>
                            <manifestSection>
                                <name>net/shibboleth/tool/xmlsectool/</name>
                                <manifestEntries>
                                    <Implementation-Title>${project.artifactId}</Implementation-Title>
                                    <Implementation-Version>${project.version}</Implementation-Version>
                                    <Implementation-Vendor>shibboleth.net</Implementation-Vendor>
                                </manifestEntries>
                            </manifestSection>
                        </manifestSections>
                    </archive>
                </configuration>
            </plugin>

            <!-- Copy the executable's dependencies into a directory. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${dependenciesDirectory}</outputDirectory>
                            <includeScope>runtime</includeScope>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <overrideUid>1000</overrideUid>
                    <overrideGid>1000</overrideGid>
                    <tarLongFileMode>gnu</tarLongFileMode>
                    <ignoreMissingDescriptor>false</ignoreMissingDescriptor>
                    <descriptors>
                        <descriptor>src/main/assembly/bin.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>net.shibboleth.maven.enforcer.rules</groupId>
                        <artifactId>maven-dist-enforcer</artifactId>
                        <version>${maven-dist-enforcer.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <jarEnforcer implementation="net.shibboleth.mvn.enforcer.impl.JarEnforcer">
                                    <dataGroupId>net.shibboleth.maven.enforcer.rules</dataGroupId>
                                    <dataArtifactId>maven-dist-enforcer-data</dataArtifactId>
                                    <dataVersion>${maven-dist-enforcer-data.version}</dataVersion>
                                    <dataKeyRing>${basedir}/src/main/enforcer/shibbolethKeys.gpg</dataKeyRing>
                                    <parentPomDir>${basedir}</parentPomDir>
                                    <zipFiles>${project.build.directory}/${project.artifactId}-${project.version}-bin.zip</zipFiles>
                                    <checkSignatures>false</checkSignatures>
                                    <checkDependencies>true</checkDependencies>
                                    <listJarSources>false</listJarSources>
                                    <checkM2>false</checkM2>
                                </jarEnforcer>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

    <issueManagement>
        <system>JIRA</system>
        <url>https://issues.shibboleth.net/jira/projects/XSTJ</url>
    </issueManagement>

</project>
