<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>de.digitalcollections</groupId>
  <artifactId>iiif-server-hymir</artifactId>
  <version>2.0.0</version>
  <packaging>war</packaging>
  
  <name>IIIF: Hymir IIIF Server</name>
  <description>Hymir is a Java based IIIF Server. It is based on "IIIF Image API Java Libraries" and "IIIF Presentation API Java Libraries" (Java implementations of the IIIF specifications, see https://github.com/dbmdz).</description>
  <url>https://github.com/dbmdz/iiif-server-hymir</url>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://github.com/dbmdz/iiif-server-hymir/blob/master/LICENSE</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Ralf Eichinger</name>
      <email>ralf.eichinger@gmail.com</email>
      <id>datazuul</id>
    </developer>
  </developers>
  <ciManagement>
    <url>https://travis-ci.org/dbmdz/iiif-server-hymir</url>
    <system>Travis CI</system>
  </ciManagement>
  <issueManagement>
    <url>https://github.com/dbmdz/iiif-server-hymir/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>
  <scm>
    <connection>https://github.com/dbmdz/iiif-server-hymir.git</connection>
    <developerConnection>git@github.com:dbmdz/iiif-server-hymir.git</developerConnection>
    <url>https://github.com/dbmdz/iiif-server-hymir</url>
  </scm>
  
  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <version.aspectjweaver>1.8.9</version.aspectjweaver>
    <version.iiif-image>2.0.1</version.iiif-image>
    <version.iiif-presentation>2.0.0</version.iiif-presentation>
    <version.jacoco-maven-plugin>0.7.4.201502262128</version.jacoco-maven-plugin>
    <version.jetty-maven-plugin>9.3.10.v20160621</version.jetty-maven-plugin>
    <version.maven-compiler-plugin>3.3</version.maven-compiler-plugin>
    <version.maven-gpg-plugin>1.6</version.maven-gpg-plugin>
    <version.maven-javadoc-plugin>2.10.4</version.maven-javadoc-plugin>
    <version.maven-source-plugin>3.0.1</version.maven-source-plugin>
    <version.maven-surefire-plugin>2.19.1</version.maven-surefire-plugin>
    <version.nexus-staging-maven-plugin>1.6.7</version.nexus-staging-maven-plugin>
    <version.slf4j>1.7.21</version.slf4j>
    <version.spring-framework>4.2.5.RELEASE</version.spring-framework>
    <version.thymeleaf>2.1.3.RELEASE</version.thymeleaf>
    <version.thymeleaf-extras-data-attribute>1.3</version.thymeleaf-extras-data-attribute>
    <version.thymeleaf-layout-dialect>1.2.9</version.thymeleaf-layout-dialect>
    <version.versions-maven-plugin>2.2</version.versions-maven-plugin>
  </properties>
  
  <dependencies>
    <dependency>
      <groupId>com.github.mxab.thymeleaf.extras</groupId>
      <artifactId>thymeleaf-extras-data-attribute</artifactId>
      <version>${version.thymeleaf-extras-data-attribute}</version>
    </dependency>
    <dependency>
      <groupId>nz.net.ultraq.thymeleaf</groupId>
      <artifactId>thymeleaf-layout-dialect</artifactId>
      <version>${version.thymeleaf-layout-dialect}</version>
    </dependency>
    <dependency>
      <groupId>de.digitalcollections</groupId>
      <artifactId>iiif-image-backend-impl</artifactId>
      <version>${version.iiif-image}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>de.digitalcollections</groupId>
      <artifactId>iiif-image-business-impl</artifactId>
      <version>${version.iiif-image}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>de.digitalcollections</groupId>
      <artifactId>iiif-image-frontend-impl-springmvc</artifactId>
      <version>${version.iiif-image}</version>
      <scope>compile</scope> <!-- not runtime, because of twelvemonkeys IIOProviderContextListener in WebappInitializer and IIIFImageApiController.VERSION-->
    </dependency>
    <dependency>
      <groupId>de.digitalcollections</groupId>
      <artifactId>iiif-presentation-backend-impl</artifactId>
      <version>${version.iiif-presentation}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>de.digitalcollections</groupId>
      <artifactId>iiif-presentation-business-impl</artifactId>
      <version>${version.iiif-presentation}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>de.digitalcollections</groupId>
      <artifactId>iiif-presentation-frontend-impl-springmvc</artifactId>
      <version>${version.iiif-presentation}</version>
      <scope>compile</scope> <!-- not runtime, because of IIIFPresentationApiController.VERSION-->
    </dependency>
    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
      <version>${version.aspectjweaver}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${version.slf4j}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${version.slf4j}</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <version>${version.spring-framework}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.thymeleaf</groupId>
      <artifactId>thymeleaf</artifactId>
      <version>${version.thymeleaf}</version>
    </dependency>
    <dependency>
      <groupId>org.thymeleaf</groupId>
      <artifactId>thymeleaf-spring4</artifactId>
      <version>${version.thymeleaf}</version>
    </dependency>
  </dependencies>


  <build>
    <finalName>hymir-${project.version}</finalName>
    
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.maven-compiler-plugin}</version>
        <configuration>
          <showDeprecation>true</showDeprecation>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${version.maven-source-plugin}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.maven-javadoc-plugin}</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.maven-surefire-plugin}</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <version>${version.versions-maven-plugin}</version>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${version.jacoco-maven-plugin}</version>
        <executions>
          <execution>
            <id>pre-unit-test</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>**/SpringConfig*</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>${version.nexus-staging-maven-plugin}</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
      
      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>${version.jetty-maven-plugin}</version>
        <configuration>
          <classesDirectory>${project.build.directory}/classes</classesDirectory>
          <scanIntervalSeconds>2</scanIntervalSeconds>
          <webApp>
            <allowDuplicateFragmentNames>true</allowDuplicateFragmentNames>
            <resourceBases>
              <resourceBase>src/main/webapp</resourceBase>
              <!--<resourceBase>${project.build.directory}/${project.build.finalName}</resourceBase>-->
            </resourceBases>
            <webInfIncludeJarPattern>.*/.*(spring-security-web|spring-webmvc|spring-web).*\.jar$</webInfIncludeJarPattern>
          </webApp>
          <systemProperties>
            <systemProperty>
              <name>spring.profiles.active</name>
              <value>local</value>
            </systemProperty>
          </systemProperties>
          <httpConnector>
            <port>9898</port>
          </httpConnector>
          <!--          <stopKey>foo</stopKey>
          <stopPort>9000</stopPort>-->
        </configuration>
      </plugin>
    </plugins>
  </build>
  
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${version.jacoco-maven-plugin}</version>
      </plugin>
    </plugins>
  </reporting>
  
  <profiles>
    <profile>
      <id>deploy</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${version.maven-gpg-plugin}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
