<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.incode</groupId>
    <artifactId>incode-build</artifactId>
    <version>2</version>

    <packaging>pom</packaging>
    
    <name>Incode Build Parent POM</name>
    <description>
        This module defines a standard parent POM to use for various Incode applications and modules.  
        Its primary purpose is to make it easy to use a set up maven mixins (https://github.com/odavid/maven-plugins)
        within child POMs.  Specifically this means locking down the versions of plugins using pluginManagement.
        
        It does NOT define any mixins for Apache Isis.
    </description>
    
    <url>https://github.com/incodehq/incode-build</url>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:git@github.com:incodehq/incode-build.git</connection>
        <developerConnection>scm:git:git@github.com:incodehq/incode-build.git</developerConnection>
        <url>git@github.com:incodehq/incode-build.git</url>
    </scm>
    <developers>
        <developer>
            <id>danhaywood</id>
            <name>Dan Haywood</name>
            <email>dan@haywood-associates.co.uk</email>
        </developer>
    </developers>    
    
    <profiles>
        <profile>
            <id>incode-build</id>
            <activation>
                <property>
                    <name>!skip.incode-build</name>
                </property>
            </activation>
        
            <properties>

                <mavenmixin-cucumberreporting.version>0.0.2</mavenmixin-cucumberreporting.version>
                <maven-cucumber-reporting.version>3.2.0</maven-cucumber-reporting.version>
                <maven-cucumber-reporting.dependency.log4j.version>2.7</maven-cucumber-reporting.dependency.log4j.version>

                <mavenmixin-datanucleusenhance.version>0.0.4</mavenmixin-datanucleusenhance.version>
                <datanucleus-maven-plugin.version>4.0.5</datanucleus-maven-plugin.version>
                <datanucleus-core.version>4.1.7</datanucleus-core.version>
                <datanucleus-api-jdo.version>4.1.1</datanucleus-api-jdo.version>
                <datanucleus-jodatime.version>4.1.0-release</datanucleus-jodatime.version>

                <mavenmixin-enforcerrelaxed.version>0.0.2</mavenmixin-enforcerrelaxed.version>
                <maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>

                <mavenmixin-jettyconsole.version>0.0.2</mavenmixin-jettyconsole.version>
                <jetty-console-maven-plugin.version>1.59</jetty-console-maven-plugin.version>
                <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>

                <mavenmixin-jettywar.version>0.0.2</mavenmixin-jettywar.version>
                <maven-war-plugin.version>2.4</maven-war-plugin.version>
                <jetty-maven-plugin.version>9.3.5.v20151012</jetty-maven-plugin.version>

                <mavenmixin-sourceandjavadoc.version>0.0.2</mavenmixin-sourceandjavadoc.version>
                <maven-javadoc-plugin.version>2.9.1</maven-javadoc-plugin.version>
                <maven-jxr-plugin.version>2.4</maven-jxr-plugin.version>
                <maven-source-plugin.version>2.2.1</maven-source-plugin.version>

                <mavenmixin-standard.version>0.0.3</mavenmixin-standard.version>
                <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
                <maven-project-info-reports-plugin.version>2.9</maven-project-info-reports-plugin.version>
                <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
                <maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
                <maven-jar-plugin.version>2.4</maven-jar-plugin.version>
                <maven-install-plugin.version>2.5.1</maven-install-plugin.version>
                <maven-deploy-plugin.version>2.8.1</maven-deploy-plugin.version>
                <maven-site-plugin.version>3.3</maven-site-plugin.version>

                <mavenmixin-surefire.version>0.0.4</mavenmixin-surefire.version>
                <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
                <maven-surefire-report-plugin.version>2.19.1</maven-surefire-report-plugin.version>

                <mavenmixin-staticanalysis.version>0.0.2</mavenmixin-staticanalysis.version>
                <maven-checkstyle-plugin.version>2.11</maven-checkstyle-plugin.version>
                <maven-pmd-plugin.version>3.0.1</maven-pmd-plugin.version>
                <javancss-maven-plugin.version>2.1</javancss-maven-plugin.version>
                <jdepend-maven-plugin.version>2.0-beta-2</jdepend-maven-plugin.version>
                <findbugs-maven-plugin.version>2.5</findbugs-maven-plugin.version>

                <mavenmixin-docker.version>0.0.3</mavenmixin-docker.version>
                <docker-maven-plugin.version>0.4.13</docker-maven-plugin.version>
                <gmavenplus-plugin.version>1.5</gmavenplus-plugin.version>

                <maven-checkstyle-plugin.configLocation>${project.basedir}/codequality/checkstyle.xml</maven-checkstyle-plugin.configLocation>
                <maven-pmd-plugin.ruleset>${project.basedir}/codequality/pmd.xml</maven-pmd-plugin.ruleset>

                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            </properties>

            <build>
                <pluginManagement>
                    <plugins>
                        <!-- mavenmixin-cucumberreporting -->
                        <plugin>
                            <groupId>net.masterthought</groupId>
                            <artifactId>maven-cucumber-reporting</artifactId>
                            <version>${maven-cucumber-reporting.version}</version>
                        </plugin>

                        <!-- mavenmixin-datanucleusenhancer -->
                        <plugin>
                            <groupId>org.datanucleus</groupId>
                            <artifactId>datanucleus-maven-plugin</artifactId>
                            <version>${datanucleus-maven-plugin.version}</version>
                        </plugin>

                        <!-- mavenmixin-docker -->
                        <plugin>
                            <groupId>com.spotify</groupId>
                            <artifactId>docker-maven-plugin</artifactId>
                            <version>${docker-maven-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <groupId>org.codehaus.gmavenplus</groupId>
                            <artifactId>gmavenplus-plugin</artifactId>
                            <version>${gmavenplus-plugin.version}</version>
                        </plugin>

                        <!-- mavenmixin-enforcerrelaxed -->
                        <plugin>
                            <artifactId>maven-enforcer-plugin</artifactId>
                            <version>${maven-enforcer-plugin.version}</version>
                        </plugin>

                        <!-- mavenmixin-jettyconsole -->
                        <plugin>
                            <groupId>org.simplericity.jettyconsole</groupId>
                            <artifactId>jetty-console-maven-plugin</artifactId>
                            <version>${jetty-console-maven-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <artifactId>maven-antrun-plugin</artifactId>
                            <version>${maven-antrun-plugin.version}</version>
                        </plugin>

                        <!-- mavenmixin-jettywar -->
                        <plugin>
                            <artifactId>maven-war-plugin</artifactId>
                            <version>${maven-war-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <groupId>org.eclipse.jetty</groupId>
                            <artifactId>jetty-maven-plugin</artifactId>
                            <version>${jetty-maven-plugin.version}</version>
                        </plugin>

                        <!-- mavenmixin-sourceandjavadoc -->
                        <plugin>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <version>${maven-javadoc-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <artifactId>maven-jxr-plugin</artifactId>
                            <version>${maven-jxr-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <artifactId>maven-source-plugin</artifactId>
                            <version>${maven-source-plugin.version}</version>
                        </plugin>

                        <!-- mavenmixin-standard -->
                        <plugin>
                            <artifactId>maven-clean-plugin</artifactId>
                            <version>${maven-clean-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <artifactId>maven-project-info-reports-plugin</artifactId>
                            <version>${maven-project-info-reports-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <artifactId>maven-resources-plugin</artifactId>
                            <version>${maven-resources-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <version>${maven-compiler-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <artifactId>maven-jar-plugin</artifactId>
                            <version>${maven-jar-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <artifactId>maven-install-plugin</artifactId>
                            <version>${maven-install-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <artifactId>maven-deploy-plugin</artifactId>
                            <version>${maven-deploy-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <artifactId>maven-site-plugin</artifactId>
                            <version>${maven-site-plugin.version}</version>
                        </plugin>

                        <!-- mavenmixin-surefire -->
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <version>${maven-surefire-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-report-plugin</artifactId>
                            <version>${maven-surefire-report-plugin.version}</version>
                        </plugin>

                        <!-- mavenmixin-staticanalysis -->
                        <plugin>
                            <artifactId>maven-checkstyle-plugin</artifactId>
                            <version>${maven-checkstyle-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <artifactId>maven-pmd-plugin</artifactId>
                            <version>${maven-pmd-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>javancss-maven-plugin</artifactId>
                            <version>${javancss-maven-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>jdepend-maven-plugin</artifactId>
                            <version>${jdepend-maven-plugin.version}</version>
                        </plugin>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>findbugs-maven-plugin</artifactId>
                            <version>${findbugs-maven-plugin.version}</version>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>

            <dependencyManagement>
                <dependencies>
                    <dependency>
                        <groupId>com.danhaywood.mavenmixin</groupId>
                        <artifactId>cucumberreporting</artifactId>
                        <version>${mavenmixin-cucumberreporting.version}</version>
                        <type>pom</type>
                    </dependency>
                    <dependency>
                        <groupId>com.danhaywood.mavenmixin</groupId>
                        <artifactId>datanucleusenhance</artifactId>
                        <version>${mavenmixin-datanucleusenhance.version}</version>
                        <type>pom</type>
                    </dependency>
                    <dependency>
                        <groupId>com.danhaywood.mavenmixin</groupId>
                        <artifactId>docker</artifactId>
                        <version>${mavenmixin-docker.version}</version>
                        <type>pom</type>
                    </dependency>
                    <dependency>
                        <groupId>com.danhaywood.mavenmixin</groupId>
                        <artifactId>enforcerrelaxed</artifactId>
                        <version>${mavenmixin-enforcerrelaxed.version}</version>
                        <type>pom</type>
                    </dependency>
                    <dependency>
                        <groupId>com.danhaywood.mavenmixin</groupId>
                        <artifactId>jettyconsole</artifactId>
                        <version>${mavenmixin-jettyconsole.version}</version>
                        <type>pom</type>
                    </dependency>
                    <dependency>
                        <groupId>com.danhaywood.mavenmixin</groupId>
                        <artifactId>jettywar</artifactId>
                        <version>${mavenmixin-jettywar.version}</version>
                        <type>pom</type>
                    </dependency>
                    <dependency>
                        <groupId>com.danhaywood.mavenmixin</groupId>
                        <artifactId>sourceandjavadoc</artifactId>
                        <version>${mavenmixin-sourceandjavadoc.version}</version>
                        <type>pom</type>
                    </dependency>
                    <dependency>
                        <groupId>com.danhaywood.mavenmixin</groupId>
                        <artifactId>standard</artifactId>
                        <version>${mavenmixin-standard.version}</version>
                        <type>pom</type>
                    </dependency>
                    <dependency>
                        <groupId>com.danhaywood.mavenmixin</groupId>
                        <artifactId>surefire</artifactId>
                        <version>${mavenmixin-surefire.version}</version>
                        <type>pom</type>
                    </dependency>
                    <dependency>
                        <groupId>com.danhaywood.mavenmixin</groupId>
                        <artifactId>staticanalysis</artifactId>
                        <version>${mavenmixin-staticanalysis.version}</version>
                        <type>pom</type>
                    </dependency>
                </dependencies>
            </dependencyManagement>

            <repositories>
                <repository>
                    <id>apache.snapshots</id>
                    <name>Apache Snapshots</name>
                    <url>https://repository.apache.org/content/repositories/snapshots/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                    </snapshots>
                </repository>

                <repository>
                    <id>estatio.snapshots</id>
                    <name>Estatio Snapshots (and Interim Releases)</name>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                        <checksumPolicy>fail</checksumPolicy>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                        <checksumPolicy>fail</checksumPolicy>
                    </snapshots>
                    <url>http://repository-estatio.forge.cloudbees.com/snapshot/</url>
                    <layout>default</layout>
                </repository>

                <repository>
                    <id>estatio.releases</id>
                    <name>Estatio Releases</name>
                    <url>http://repository-estatio.forge.cloudbees.com/release/</url>
                    <layout>default</layout>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                        <checksumPolicy>fail</checksumPolicy>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>

                <repository>
                    <id>sonatype-snapshots</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>

            <pluginRepositories>
                <pluginRepository>
                    <id>estatio.snapshots</id>
                    <name>Estatio Snapshots (and Interim Releases)</name>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                        <checksumPolicy>fail</checksumPolicy>
                    </releases>
                    <url>http://repository-estatio.forge.cloudbees.com/snapshot/</url>
                    <layout>default</layout>
                </pluginRepository>
            </pluginRepositories>

        </profile>

        <profile>
            <id>danhaywood-mavenmixin-sonatyperelease</id>
            <!-- 
            this profile is not part of the mixin, but is required to be defined as a profile
            in order to release this mixin pom.xml to Maven Central repo
            -->
            <build>
                <plugins>
                    <!-- http://central.sonatype.org/pages/apache-maven.html -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.2</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <!-- http://kohsuke.org/pgp-maven-plugin/secretkey.html instead of maven-gpg-plugin -->
                    <plugin>
                        <groupId>org.kohsuke</groupId>
                        <artifactId>pgp-maven-plugin</artifactId>
                        <version>1.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
    </profiles>

</project>
