<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2019 Red Hat, Inc. and/or its affiliates.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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>org.optaweb.employeerostering</groupId>
    <artifactId>employee-rostering</artifactId>
    <version>7.30.0.Final</version>
  </parent>

  <artifactId>employee-rostering-benchmark</artifactId>
  <packaging>jar</packaging>

  <name>Employee Rostering as a Service Benchmark</name>

  <properties>
    <checkstyle.header.template><![CDATA[
^\/\*$\n^
\* Copyright \d\d\d\d Red Hat, Inc\. and\/or its affiliates\.$\n^
\*$\n^
\* Licensed under the Apache License, Version 2\.0 \(the &quot;License&quot;\);$\n^
\* you may not use this file except in compliance with the License\.$\n^
\* You may obtain a copy of the License at$\n^
\*$\n^
\*     http:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0$\n^
\*$\n^
\* Unless required by applicable law or agreed to in writing, software$\n^
\* distributed under the License is distributed on an &quot;AS IS&quot; BASIS,$\n^
\* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$\n^
\* See the License for the specific language governing permissions and$\n^
\* limitations under the License\.$\n^
\*\/$
]]>
    </checkstyle.header.template>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.optaweb.employeerostering</groupId>
      <artifactId>employee-rostering-backend</artifactId>
    </dependency>

    <!-- OptaPlanner dependencies -->
    <dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-benchmark</artifactId>
      <exclusions>
        <exclusion>
          <groupId>javax.activation</groupId>
          <artifactId>activation</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Testing dependencies -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>jacoco</id>
      <properties>
        <jacoco.excludes>*Lexer</jacoco.excludes>
        <jacoco.exec.file>${project.build.directory}/jacoco.exec</jacoco.exec.file>
        <jacoco.agent.line>-javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${version.jacoco.plugin}/org.jacoco.agent-${version.jacoco.plugin}-runtime.jar=destfile=${jacoco.exec.file},append=true,excludes=${jacoco.excludes}</jacoco.agent.line>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.jacoco</groupId>
          <artifactId>org.jacoco.agent</artifactId>
          <classifier>runtime</classifier>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
              <version>${version.jacoco.plugin}</version>
              <configuration>
                <append>true</append>
                <destFile>${jacoco.exec.file}</destFile>
                <excludes>
                  <exclude>${jacoco.excludes}</exclude>
                </excludes>
              </configuration>
              <executions>
                <execution>
                  <id>default-instrument</id>
                  <goals>
                    <goal>instrument</goal>
                  </goals>
                </execution>
                <execution>
                  <id>default-restore-instrumented-classes</id>
                  <goals>
                    <goal>restore-instrumented-classes</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven2-plugin</artifactId>
              <configuration>
                <configuration>
                  <properties>
                    <cargo.start.jvmargs>${jacoco.agent.line}</cargo.start.jvmargs>
                  </properties>
                </configuration>
              </configuration>
              <dependencies>
                <dependency>
                  <groupId>org.jacoco</groupId>
                  <artifactId>org.jacoco.agent</artifactId>
                  <version>${version.jacoco.plugin}</version>
                </dependency>
              </dependencies>
            </plugin>
            <plugin>
              <artifactId>maven-surefire-plugin</artifactId>
              <configuration>
                <systemPropertyVariables>
                  <jacoco-agent.destfile>${jacoco.exec.file}</jacoco-agent.destfile>
                </systemPropertyVariables>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
