<?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">
  <parent>
    <artifactId>cassieq</artifactId>
    <groupId>io.paradoxical</groupId>
    <version>0.10</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>cassieq-core</artifactId>
  <name>Service Core</name>
  <description>The core CassieQ server</description>
  <prerequisites>
    <maven>3.0.0</maven>
  </prerequisites>
  <build>
    <finalName>${project.artifactId}-${project.version}-r${buildNumber}</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${maven.shade.version}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <transformers>
                <transformer />
                <transformer>
                  <mainClass>io.paradoxical.cassieq.ServiceApplication</mainClass>
                  <manifestEntries>
                    <SCM-Revision>${buildNumber}</SCM-Revision>
                    <SCM-Branch>${scmBranch}</SCM-Branch>
                  </manifestEntries>
                </transformer>
              </transformers>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>${maven.exec.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>io.paradoxical.cassieq.ServiceApplication</mainClass>
          <arguments>
            <argument>server</argument>
            <argument>rpm/conf/configuration.yml</argument>
          </arguments>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <test>suites.BuildVerificationTestSuite</test>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven.source.plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.spotify</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>0.3.3</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <skipDockerBuild>${docker.skipBuild}</skipDockerBuild>
          <skipDockerTag>${docker.skipTag}</skipDockerTag>
          <imageName>${dockerRepo}/cassieq:${buildNumber}</imageName>
          <dockerDirectory>${project.basedir}/docker</dockerDirectory>
          <pullOnBuild>${docker.pullOnBuild}</pullOnBuild>
          <resources>
            <resource>
              <targetPath>/data/lib</targetPath>
              <directory>${project.build.directory}</directory>
              <include>${project.build.finalName}.jar</include>
            </resource>
            <resource>
              <targetPath>/data/db</targetPath>
              <directory>db/scripts</directory>
              <include>*.cql</include>
            </resource>
          </resources>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <repositories>
    <repository>
      <id>oss.sonatype.org</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>uk.co.jemos.podam</groupId>
      <artifactId>podam</artifactId>
      <version>5.4.0.RELEASE</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>jcip-annotations</artifactId>
          <groupId>net.jcip</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jsr250-api</artifactId>
          <groupId>javax.annotation</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jbehave-core</artifactId>
          <groupId>org.jbehave</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jbehave-core</artifactId>
          <groupId>org.jbehave</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jbehave-site-resources</artifactId>
          <groupId>org.jbehave.site</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jbehave-junit-runner</artifactId>
          <groupId>de.codecentric</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.paradoxical</groupId>
      <artifactId>cassandra.loader</artifactId>
      <version>1.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>slf4j-log4j12</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>cassandra-unit</artifactId>
          <groupId>org.cassandraunit</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-cli</artifactId>
          <groupId>commons-cli</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.paradoxical</groupId>
      <artifactId>cassieq-client</artifactId>
      <version>0.10</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.16.6</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.2.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

