<?xml version="1.0"?>
<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>com.bluetrainsoftware.parent</groupId>
    <artifactId>central-parent</artifactId>
    <version>1.3</version>
  </parent>

  <artifactId>groovy-parent</artifactId>
  <version>1.5</version>
  <packaging>pom</packaging>
  <name>Blue Train Software Ltd - Groovy Parent</name>
  <properties>
    <groovy.version>2.3.6</groovy.version>
    <sonar.language>groovy</sonar.language>
	  <bts.skip.integration.tests>false</bts.skip.integration.tests>
	  <bts.skip.functional.tests>false</bts.skip.functional.tests>
	  <it.test />
	  <ft.test />
  </properties>
  <scm>
    <connection>scm:git:git@github.com:rvowles/groovy-parent.git</connection>
    <developerConnection>scm:git:git@github.com:rvowles/groovy-parent.git</developerConnection>
    <url>git@github.com:rvowles/groovy-parent.git</url>
    <tag>groovy-parent-1.5</tag>
  </scm>
  <build>
    <plugins>
	    <plugin>
		    <groupId>org.codehaus.gmavenplus</groupId>
		    <artifactId>gmavenplus-plugin</artifactId>
		    <version>1.2</version>
		    <executions>
			    <execution>
				    <goals>
					    <goal>addSources</goal>
					    <goal>addTestSources</goal>
					    <goal>compile</goal>
					    <goal>testCompile</goal>
				    </goals>
			    </execution>
		    </executions>
	    </plugin>

	    <plugin>
		    <groupId>com.bluetrainsoftware.maven</groupId>
		    <artifactId>release-pom</artifactId>
		    <version>1.5</version>
		    <executions>
			    <execution>
				    <id>generate-dep-list</id>
				    <phase>prepare-package</phase>
				    <goals>
					    <goal>release-pom</goal>
				    </goals>
				    <configuration>
					    <useMaven2>false</useMaven2>
					    <outputFile>${project.build.outputDirectory}/META-INF/maven/released-pom.xml</outputFile>
				    </configuration>
			    </execution>
		    </executions>
	    </plugin>

	    <plugin>
		    <groupId>org.jacoco</groupId>
		    <artifactId>jacoco-maven-plugin</artifactId>
		    <version>0.6.5.201403032054</version>
		    <executions>
			    <execution>
				    <id>prepare-agent</id>
				    <goals>
					    <goal>prepare-agent</goal>
				    </goals>
			    </execution>
			    <execution>
				    <id>report</id>
				    <phase>prepare-package</phase>
				    <goals>
					    <goal>report</goal>
				    </goals>
			    </execution>
		    </executions>
	    </plugin>

	    <plugin>
		    <groupId>org.apache.maven.plugins</groupId>
		    <artifactId>maven-surefire-plugin</artifactId>
		    <version>2.17</version>
		    <configuration>
			    <useSystemClassLoader>true</useSystemClassLoader>
			    <useManifestOnlyJar>false</useManifestOnlyJar>
			    <failIfNoTests>false</failIfNoTests>
			    <includes>
				    <include>**/*Test.java</include>
				    <include>**/*Tests.java</include>
			    </includes>
			    <excludes>
				    <exclude>**/*$*</exclude>
				    <exclude>**/*IntegrationTest.java</exclude>
				    <exclude>**/*IntegrationTests.java</exclude>
				    <exclude>**/*FunctionalTest.java</exclude>
				    <exclude>**/*FunctionalTests.java</exclude>
			    </excludes>
		    </configuration>
		    <executions>
			    <execution>
				    <id>integration-test</id>
				    <phase>test</phase>
				    <goals>
					    <goal>test</goal>
				    </goals>
				    <configuration>
					    <skipTests>${bts.skip.integration.tests}</skipTests>
					    <includes>
						    <include>**/*IntegrationTest.java</include>
						    <include>**/*IntegrationTests.java</include>
					    </includes>
					    <excludes>
						    <exclude>**/*$*</exclude>
					    </excludes>
					    <test>${it.test}</test> <!-- specify -Dit.test=testname to run individual test -->
				    </configuration>
			    </execution>
		    </executions>
	    </plugin>

	    <plugin>
		    <groupId>org.apache.maven.plugins</groupId>
		    <artifactId>maven-failsafe-plugin</artifactId>
		    <version>2.17</version>
		    <configuration>
			    <argLine>-Xms512M -Xmx512M</argLine>
			    <failIfNoTests>false</failIfNoTests>
			    <encoding>${project.build.sourceEncoding}</encoding>
			    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
			    <summaryFile>${project.build.directory}/surefire-reports/failsafe-summary.xml</summaryFile>
			    <skipTests>${bts.skip.functional.tests}</skipTests>
			    <excludes>
				    <exclude>**/*$*</exclude>
			    </excludes>
			    <includes>
				    <include>**/*FunctionalTest.java</include>
				    <include>**/*FunctionalTests.java</include>
			    </includes>
			    <test>${ft.test}</test>
		    </configuration>
		    <executions>
			    <execution>
				    <id>functional-test</id>
				    <goals>
					    <goal>integration-test</goal>
				    </goals>
			    </execution>
			    <execution>
				    <id>verify</id>
				    <goals>
					    <goal>verify</goal>
				    </goals>
			    </execution>
		    </executions>
	    </plugin>

      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>package</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.bluetrainsoftware.maven</groupId>
        <artifactId>groovydoc-maven-plugin</artifactId>
        <version>1.3</version>
        <executions>
          <execution>
            <id>attach-docs</id>
            <goals>
              <goal>attach-docs</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
