<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>

    <groupId>no.difi.commons</groupId>
    <artifactId>commons-asic</artifactId>
    <version>0.9.2</version>
    <packaging>jar</packaging>

    <name>Associated Signature Container (ASiC)</name>
    <description>Generic implementation of ASiC-E archives in accordance with ETSI 102 918 v1.3.1.</description>
    <url>https://github.com/difi/asic</url>

    <scm>
        <tag>commons-asic-0.9.2</tag>
        <url>https://github.com/difi/asic</url>
        <connection>scm:git:https://github.com/difi/asic.git</connection>
        <developerConnection>scm:git:git@github.com:difi/asic.git</developerConnection>
    </scm>

    <issueManagement>
        <url>https://github.com/difi/asic/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <organization>
        <name>Norwegian Agency for Public Management and eGovernment (Difi)</name>
        <url>http://www.difi.no/</url>
    </organization>

    <developers>
        <developer>
            <name>Steinar Overbeck Cook</name>
            <email>soc@difi.no</email>
            <organization>Difi</organization>
            <roles>
                <role>Author</role>
            </roles>
        </developer>
        <developer>
            <name>Erlend Klakegg Bergheim</name>
            <email>erlend.klakegg.bergheim@difi.no</email>
            <organization>Difi</organization>
            <roles>
                <role>Author</role>
            </roles>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>GNU Lesser General Public License (LGPL), Version 3.0</name>
            <url>http://www.gnu.org/licenses/lgpl-3.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <java.encoding>UTF-8</java.encoding>
        <java.version>1.7</java.version>
    </properties>

    <dependencies>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.21</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.1.7</version>
            <scope>test</scope>
        </dependency>

        <!-- Commons -->
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.10</version>
            <scope>test</scope>
        </dependency>

        <!-- Bouncy Castle is used for creating and verifying signatures -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
            <version>1.54</version>
        </dependency>

        <!-- Google -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>19.0</version>
        </dependency>

        <!-- TestNG testing framework -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.9</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <defaultGoal>clean install</defaultGoal>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**/*.pdf</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <!-- Explicitly declares which version of Java to use -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${java.encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <encoding>${java.encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <failIfNoTests>true</failIfNoTests>
                    <!-- Seems this will alleviate the problem of out-of-memory -->
                    <useSystemClassLoader>false</useSystemClassLoader>
                </configuration>
            </plugin>
            <plugin>
                <!-- JAXB plugin generates Java classes corresponding to the XML Schema Definitions found in this project -->
                <!-- See  https://github.com/highsource/maven-jaxb2-plugin -->
                <!-- Documentation at https://github.com/highsource/maven-jaxb2-plugin/wiki -->
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>0.12.3</version>
                <executions>
                    <execution>
                        <id>xsd</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <schemaDirectory>src/main/xsd</schemaDirectory>
                            <bindingDirectory>src/main/xjb</bindingDirectory>
                            <!-- If you want to generate the classes into a different directory than the default, this is how you do it. -->
                            <!-- <generateDirectory>${project.build.directory}/generated-sources/xjc-xsd</generateDirectory> -->
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.7</version>
                    <configuration>
                        <formats>
                            <format>html</format>
                            <format>xml</format>
                        </formats>
                        <instrumentation>
                            <excludes>
                                <exclude>org/etsi/**/*.class</exclude>
                                <exclude>org/w3/**/*.class</exclude>
                                <exclude>oasis/names/**/*.class</exclude>
                                <exclude>no/difi/xsd/**/*.class</exclude>
                            </excludes>
                        </instrumentation>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.3</version>
                    <executions>
                        <execution>
                            <id>package-javadoc</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <encoding>${java.encoding}</encoding>
                        <excludePackageNames>org.etsi.*:org.w3.*:oasis.names.*:no.difi.xsd.*</excludePackageNames>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <id>package-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.3</version>
                        <executions>
                            <execution>
                                <id>package-javadoc</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <encoding>${java.encoding}</encoding>
                            <excludePackageNames>org.etsi.*:org.w3.*:oasis.names.*:no.difi.xsd.*</excludePackageNames>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
