<?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>
    <artifactId>ju</artifactId>
    <groupId>ch.inftec.ju</groupId>
    <version>4.5.1-11</version>
  </parent>
  <artifactId>ju-version-override</artifactId>
  <packaging>jar</packaging>
  <!-- Override version for local build... -->
  <!--     <version>4.5-local-mm-2</version> -->
  <properties>
    <maven.version>3.2.5</maven.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>${maven.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model-builder</artifactId>
      <version>${maven.version}</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-component-annotations</artifactId>
      <version>1.5.5</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>1.10.8</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <executions>
          <execution>
            <id>default-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <excludes>
                <exclude>**/*Jenkins*</exclude>
                <exclude>**/*Bamboo*</exclude>
              </excludes>
              <environmentVariables>
                <!-- unsetting all environment variables when tests run on Bamboo or Jenkins -->
                <bamboo_repository_branch_name />
                <bamboo_buildKey />
                <GIT_BRANCH />
                <JOB_NAME />
              </environmentVariables>
            </configuration>
          </execution>
          <!-- the following two test confiugrations are actually intgration tests -->
          <execution>
            <id>bamboo</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <environmentVariables>
                <bamboo_repository_branch_name>bamboo/TEC-888-make-a-feature</bamboo_repository_branch_name>
                <bamboo_buildKey>bamboo-build</bamboo_buildKey>
                <bamboo_buildNumber>123</bamboo_buildNumber>
                <!-- as the following env vars are used to detect the build server we have to override in case the build runs on Jenkins -->
                <GIT_BRANCH />
                <JOB_NAME />
              </environmentVariables>
              <includes>
                <include>**/*Bamboo*</include>
              </includes>
            </configuration>
          </execution>
          <execution>
            <id>jenkins</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <environmentVariables>
                <GIT_BRANCH>jenkins/PR-31-include-versionoverride</GIT_BRANCH>
                <JOB_NAME>foobar_build</JOB_NAME>
                <BUILD_NUMBER>321</BUILD_NUMBER>
                <!-- as the following env vars are used to detect the build server we have to override in case the build runs on Bamboo -->
                <bamboo_repository_branch_name />
                <bamboo_buildKey />
              </environmentVariables>
              <includes>
                <include>**/*Jenkins*</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.7.2.201409121644</version>
        <executions>
          <execution>
            <id>default-prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>default-report</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>default-check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <rules>
                <!-- implmentation is needed only for Maven 2 -->
                <rule implementation="org.jacoco.maven.RuleConfiguration">
                  <element>BUNDLE</element>
                  <limits>
                    <!-- implmentation is needed only for Maven 2 -->
                    <limit implementation="org.jacoco.report.check.Limit">
                      <counter>COMPLEXITY</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.6</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
