<?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>se.sunet.ati</groupId>
    <artifactId>ati-parent</artifactId>
    <version>2</version>
    <relativePath>../ati-parent/pom.xml</relativePath>
  </parent>

  <groupId>se.sunet.ati.ladok</groupId>
  <artifactId>ati-ladok3-rest-client</artifactId>
  <version>0.72</version>
  <packaging>bundle</packaging>

  <name>ATI Ladok 3 REST Client</name>
  <description>A Ladok 3 REST Client as an OSGi-bundle.</description>
  <url>https://github.com/uppsala-university/ati-ladok3-rest-client</url>

  <scm>
    <connection>scm:git:https://github.com/uppsala-university/ati-ladok3-rest-client.git</connection>
    <developerConnection>scm:git:https://github.com/uppsala-university/ati-ladok3-rest-client.git</developerConnection>
    <url>https://github.com/uppsala-university/ati-ladok3-rest-client</url>
    <tag>ati-ladok3-rest-client-0.72</tag>
  </scm>

  <dependencies>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.2</version>
    </dependency>
    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>javax.ws.rs-api</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.17</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.5</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-common</artifactId>
      <version>2.4</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-client</artifactId>
      <version>2.4</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-moxy</artifactId>
      <version>2.4</version>
    </dependency>
    <dependency>
      <groupId>se.sunet.ati.ladok</groupId>
      <artifactId>ati-ladok3-dto</artifactId>
      <version>0.72</version>
      <type>bundle</type>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <!-- Extend/override configuration from parent pom.xml -->
        <configuration>
          <instructions>
            <Import-Package>
              *,
              org.osgi.service.blueprint,
              javax.net.ssl,
              javax.ws.rs.client;version="[2.0,3)",
              javax.ws.rs.core;version="[2.0,3)",
              javax.xml.bind.annotation,
              org.apache.commons.logging;version="[1.0.4,1.3)",
            </Import-Package>
            <Export-Package>
              se.sunet.ati.ladok.rest.services.impl,
              se.sunet.ati.ladok.rest.services
            </Export-Package>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <!-- The integration tests connect to external services, which are not
           always reachable. They also require that you properly set up the
           configuration file restclient.properties. -->
      <id>run-its</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <excludes>
                <exclude>**/*UUDemoITCase.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!-- Integration tests against UU MIT-demo (which may not always be available) -->
      <id>uu-demo-it</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <includes>
                <include>**/*UUDemoITCase.java</include>
              </includes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
