<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2016-2019 Crown Copyright
  ~
  ~ 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>uk.gov.gchq.gaffer</groupId>
        <artifactId>gaffer2</artifactId>
        <version>1.21.1</version>
    </parent>

    <artifactId>gaffer-tools</artifactId>
    <version>1.21.2</version>
    <packaging>pom</packaging>

    <modules>
        <module>ui</module>
        <module>mini-accumulo-cluster</module>
        <module>performance-testing</module>
        <module>random-element-generation</module>
        <module>schema-builder</module>
        <module>slider</module>
        <module>analytics</module>
    </modules>

    <properties>
        <gaffer.version>1.21.1</gaffer.version>
        <scm.url>
            https://github.com/gchq/gaffer-tools
        </scm.url>
        <scm.connection>
            scm:git:https://github.com/gchq/gaffer-tools.git
        </scm.connection>
        <scm.developer.connection>
            scm:git:https://github.com/gchq/gaffer-tools.git
        </scm.developer.connection>
    </properties>

    <developers>
        <developer>
            <name>GafferDevelopers</name>
            <organization>GCHQ</organization>
            <organizationUrl>https://github.com/gchq</organizationUrl>
        </developer>
    </developers>

    <scm>
        <url>${scm.url}</url>
        <connection>${scm.connection}</connection>
        <developerConnection>${scm.developer.connection}</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <configuration>
                    <configLocation>code-style/checkstyle.xml</configLocation>
                    <suppressionsLocation>
                        code-style/checkstyle-suppressions.xml
                    </suppressionsLocation>
                    <suppressionsFileExpression>checkstyle.suppressions.file
                    </suppressionsFileExpression>
                    <encoding>UTF-8</encoding>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <headerLocation>code-style/licenseHeader.txt
                    </headerLocation>
                    <excludes>**/generated/**/*</excludes>
                    <sourceDirectories>
                        <sourceDirectory>${project.build.sourceDirectory}
                        </sourceDirectory>
                        <sourceDirectory>${project.build.testSourceDirectory}
                        </sourceDirectory>
                    </sourceDirectories>
                </configuration>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>test</phase>
                        <configuration>
                            <configLocation>code-style/checkstyle.xml
                            </configLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <headerLocation>code-style/licenseHeader.txt
                            </headerLocation>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration combine.self="override">

                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>system-test</id>
            <properties>
                <skip.surefire.tests>true</skip.surefire.tests>
                <skip.failsafe.tests>false</skip.failsafe.tests>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${failsafe.version}</version>
                        <executions>
                            <execution>
                                <id>system-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <skipITs>${skip.failsafe.tests}</skipITs>
                            <excludes>
                                <exclude>**/*$*</exclude>
                                <exclude>**/performance/**</exclude>
                            </excludes>
                            <includes>
                                <include>**/*SystemTest.java</include>
                                <include>**/*ST.java</include>
                                <include>**/*STs.java</include>
                                <include>**/*SystemTests.java</include>
                            </includes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>validate</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>analyze-compile</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
