<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>com.garethahealy</groupId>
        <artifactId>projects-pom</artifactId>
        <version>1.0.6</version>
        <relativePath>../</relativePath>
    </parent>
    <artifactId>plugins-parent</artifactId>
    <packaging>pom</packaging>
    <name>${project.artifactId}</name>

    <properties>
        <building-tools-verson>1.0.6</building-tools-verson>

        <!-- Plugin versions -->
        <maven-bundle-plugin-version>2.3.4</maven-bundle-plugin-version>
        <maven-source-plugin-version>2.1.1</maven-source-plugin-version>
        <maven-antrun-plugin-version>1.2</maven-antrun-plugin-version>
        <maven-compiler-plugin-version>2.3.2</maven-compiler-plugin-version>
        <maven-surefire-plugin-version>2.18.1</maven-surefire-plugin-version>
        <depends-maven-plugin-version>1.2</depends-maven-plugin-version>
        <properties-maven-plugin-version>1.0-alpha-2</properties-maven-plugin-version>
        <ant-contrib-version>1.0b3</ant-contrib-version>
        <ant-optional-version>1.5.3-1</ant-optional-version>
        <maven-resources-plugin-version>2.6</maven-resources-plugin-version>
        <build-helper-maven-plugin-version>1.7</build-helper-maven-plugin-version>
        <fabric8-maven-plugin-version>1.1.0.CR5</fabric8-maven-plugin-version>
        <exec-maven-plugin-version>1.3.2</exec-maven-plugin-version>
        <findbugs-maven-plugin-version>3.0.1</findbugs-maven-plugin-version>
        <maven-checkstyle-plugin-version>2.15</maven-checkstyle-plugin-version>
        <ekstazi-core-version>4.3.1</ekstazi-core-version>
        <ekstazi-m2-path>${user.home}/.m2/repository/org/ekstazi/org.ekstazi.core/${ekstazi-core-version}/org.ekstazi.core-${ekstazi-core-version}</ekstazi-m2-path>
        <license-maven-plugin-version>1.8</license-maven-plugin-version>
        <rhq-agent-plugin-plugin-version>1.0</rhq-agent-plugin-plugin-version>
        <versioneye-maven-plugin-version>3.1.0</versioneye-maven-plugin-version>
        <maven-dependency-plugin>2.10</maven-dependency-plugin>
        <maven-jar-plugin-version>2.5</maven-jar-plugin-version>
        <sonar-maven-plugin-version>2.5</sonar-maven-plugin-version>
        <cobertura-maven-plugin-version>2.6</cobertura-maven-plugin-version>
        <maven-shade-plugin-version>2.3</maven-shade-plugin-version>
        <spring-boot-version>1.2.3.RELEASE</spring-boot-version>
        <maven-war-plugin-version>2.6</maven-war-plugin-version>
        <xml-maven-plugin-version>1.0</xml-maven-plugin-version>
        <maven-assembly-plugin-version>2.5.4</maven-assembly-plugin-version>

        <!-- Plugin dependancy versions -->
        <jaxb-version>2.1.13</jaxb-version>
        <jaxb-api-version>2.1</jaxb-api-version>
    </properties>

    <!-- Build plugins -->
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <!-- http://maven.apache.org/plugins/maven-compiler-plugin/ -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://maven.apache.org/plugins/maven-resources-plugin/ -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://maven.apache.org/plugins/maven-source-plugin/ -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://mojo.codehaus.org/build-helper-maven-plugin/ -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${build-helper-maven-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://maven.apache.org/surefire/maven-surefire-plugin -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://mojo.codehaus.org/exec-maven-plugin/ -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${exec-maven-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://openjpa.apache.org/enhancement-with-maven.html -->
                    <groupId>org.apache.openjpa</groupId>
                    <artifactId>openjpa-maven-plugin</artifactId>
                    <version>${openjpa-version}</version>
                </plugin>
                <plugin>
                    <!-- http://mojo.codehaus.org/findbugs-maven-plugin-3.0.0/ -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>${findbugs-maven-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://maven.apache.org/plugins/maven-checkstyle-plugin/index.html -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${maven-checkstyle-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://mojo.codehaus.org/license-maven-plugin/ -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license-maven-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://maven.apache.org/plugins/maven-dependency-plugin/ -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin}</version>
                </plugin>
                <plugin>
                    <!-- http://maven.apache.org/plugins/maven-jar-plugin/ -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://mojo.codehaus.org/sonar-maven-plugin -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>${sonar-maven-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://mojo.codehaus.org/cobertura-maven-plugin/ -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>${cobertura-maven-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://maven.apache.org/plugins/maven-shade-plugin/ -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- https://github.com/versioneye/versioneye_maven_plugin -->
                    <groupId>com.versioneye</groupId>
                    <artifactId>versioneye-maven-plugin</artifactId>
                    <version>${versioneye-maven-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>${maven-war-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://rhq-project.github.io/rhq-agent-plugin-plugin/ -->
                    <groupId>org.rhq.maven.plugins</groupId>
                    <artifactId>rhq-agent-plugin-plugin</artifactId>
                    <version>${rhq-agent-plugin-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- http://mojo.codehaus.org/xml-maven-plugin -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>xml-maven-plugin</artifactId>
                    <version>${xml-maven-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- https://maven.apache.org/components/plugins/maven-assembly-plugin/ -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin-version}</version>
                </plugin>
                <plugin>
                    <!-- https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html -->
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>license-maven-plugin</artifactId>
                                        <versionRange>[${license-maven-plugin-version},)</versionRange>
                                        <goals>
                                            <goal>update-file-header</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore/>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- General plugins which make the JARs -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java-runtime}</source>
                    <target>${java-runtime}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Testing plugins -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <!--<configuration>
                    <argLine>-javaagent:${ekstazi-m2-path}.jar=mode=junit</argLine>
                </configuration>-->
                <dependencies>
                    <dependency>
                        <groupId>org.ekstazi</groupId>
                        <artifactId>org.ekstazi.core</artifactId>
                        <version>${ekstazi-core-version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- Code quality plugins -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>com.garethahealy</groupId>
                        <artifactId>building-tools</artifactId>
                        <version>${building-tools-verson}</version>
                        <scope>compile</scope>
                    </dependency>
                </dependencies>
                <configuration>
                    <effort>Max</effort>
                    <threshold>Low</threshold>
                    <xmlOutput>true</xmlOutput>
                    <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>com.garethahealy</groupId>
                        <artifactId>building-tools</artifactId>
                        <version>${building-tools-verson}</version>
                        <scope>compile</scope>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>camel-checkstyle.xml</configLocation>
                            <suppressionsLocation>camel-checkstyle-suppressions.xml</suppressionsLocation>
                            <consoleOutput>true</consoleOutput>
                            <failOnViolation>true</failOnViolation>
                            <failsOnError>true</failsOnError>
                            <encoding>UTF-8</encoding>
                            <sourceDirectory>${basedir}/src</sourceDirectory>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <check>
                        <haltOnFailure>false</haltOnFailure>
                        <lineRate>70</lineRate>
                        <totalLineRate>70</totalLineRate>
                        <branchRate>70</branchRate>
                        <totalBranchRate>70</totalBranchRate>
                    </check>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>clean</goal>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Governance plugins -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>update-file-header</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.versioneye</groupId>
                <artifactId>versioneye-maven-plugin</artifactId>
                <configuration>
                    <propertiesPath>${basedir}/../versioneye.properties</propertiesPath>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
</project>
