<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
/**
 * Copyright (c) Codice Foundation
 *
 * This is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either
 * version 3 of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License is distributed along with this program and can be found at
 * <http://www.gnu.org/licenses/lgpl.html>.
 *
 **/
-->
<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>org.codice</groupId>
        <artifactId>alliance</artifactId>
        <version>1.17.5</version>
    </parent>

    <groupId>org.codice</groupId>
    <artifactId>gitsetup</artifactId>
    <packaging>pom</packaging>
    <name>Alliance Git Setup</name>
    <description>Alliance Git Setup Scripts and Configuration</description>

    <dependencies>
        <dependency>
            <groupId>ddf.support</groupId>
            <artifactId>support-githooks</artifactId>
            <version>${ddf.support.version}</version>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>gitsetup</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.5.0</version>
                        <executions>
                            <execution>
                                <id>install-hooks</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>org.codice.git.Setup</mainClass>
                                    <arguments>
                                       <argument>${project.basedir}</argument>
                                        <argument>install</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>clean-hooks</id>
                                <phase>clean</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>org.codice.git.Setup</mainClass>
                                    <arguments>
                                        <argument>${project.basedir}</argument>
                                        <argument>clean</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>gitclasspath</id>
            <!--
              this profile will automatically activate if the classpath cached file doesn't exist
              in order to re-generate it
            -->
            <activation>
                <file>
                    <missing>${basedir}/classpath.txt</missing>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.0.0</version>
                        <executions>
                            <execution>
                                <id>build-classpath</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>build-classpath</goal>
                                </goals>
                                <configuration>
                                    <includeScope>runtime</includeScope>
                                    <outputFile>classpath.txt</outputFile>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <!-- Deactivate plugins from parent pom not required here -->
            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
                <executions>
                    <execution>
                        <id>checkstyle-check</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>checkstyle-check-xml</id>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>${dependency-check-maven.version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
