<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.machinecode</groupId>
    <artifactId>machinecode-parent</artifactId>
    <version>1.0.5</version>

    <packaging>pom</packaging>

    <name>MachineCode Parent POM</name>
    <description>Parent POM for MachineCode projects</description>
    <url>${url.machinecode.io}</url>

    <modules>
        <module>checkstyle</module>
    </modules>

    <developers>
        <developer>
            <id>brentdouglas</id>
            <name>Brent Douglas</name>
            <email>brent.n.douglas@gmail.com</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache License Version 2.0</name>
            <url>http://repository.jboss.org/licenses/apache-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:${git.machinecode.io}/machinecode-parent-pom.git</connection>
        <developerConnection>scm:git:${git.machinecode.io}/machinecode-parent-pom.git</developerConnection>
        <url>${github.machinecode.io}/machinecode-parent-pom</url>
    </scm>

    <organization>
        <name>MachineCode</name>
        <url>${url.machinecode.io}</url>
    </organization>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <version.java>1.7</version.java>

        <repository.machinecode.io>https://oss.sonatype.org/service/local/staging/deploy/maven2</repository.machinecode.io>
        <snapshots.machinecode.io>https://oss.sonatype.org/content/repositories/snapshots</snapshots.machinecode.io>
        <git.machinecode.io>git@github.com:machinecode-io</git.machinecode.io>
        <github.machinecode.io>http://github.com/machinecode-io</github.machinecode.io>
        <url.machinecode.io>http://machinecode.io</url.machinecode.io>

        <version.io.machinecode.checkstyle>1.0.5</version.io.machinecode.checkstyle>

        <version.org.apache.maven.plugins.maven-assembly-plugin>2.4.1</version.org.apache.maven.plugins.maven-assembly-plugin>
        <version.org.apache.maven.plugins.maven-compiler-plugin>3.1</version.org.apache.maven.plugins.maven-compiler-plugin>
        <version.org.apache.maven.plugins.maven-checkstyle-plugin>2.13</version.org.apache.maven.plugins.maven-checkstyle-plugin>
        <version.org.apache.maven.plugins.maven-dependency-plugin>2.9</version.org.apache.maven.plugins.maven-dependency-plugin>
        <version.org.apache.maven.plugins.maven-ear-plugin>2.9.1</version.org.apache.maven.plugins.maven-ear-plugin>
        <version.org.apache.maven.plugins.maven-ejb-plugin>2.4</version.org.apache.maven.plugins.maven-ejb-plugin>
        <version.org.apache.maven.plugins.maven-failsafe-plugin>2.17</version.org.apache.maven.plugins.maven-failsafe-plugin>
        <version.org.apache.maven.plugins.maven-gpg-plugin>1.5</version.org.apache.maven.plugins.maven-gpg-plugin>
        <version.org.apache.maven.plugins.maven-help-plugin>2.2</version.org.apache.maven.plugins.maven-help-plugin>
        <version.org.apache.maven.plugins.maven-jar-plugin>2.5</version.org.apache.maven.plugins.maven-jar-plugin>
        <version.org.apache.maven.plugins.maven-javadoc-plugin>2.10.1</version.org.apache.maven.plugins.maven-javadoc-plugin>
        <version.org.apache.maven.plugins.maven-resources-plugin>2.7</version.org.apache.maven.plugins.maven-resources-plugin>
        <version.org.apache.maven.plugins.maven-source-plugin>2.3</version.org.apache.maven.plugins.maven-source-plugin>
        <version.org.apache.maven.plugins.maven-surefire-plugin>2.17</version.org.apache.maven.plugins.maven-surefire-plugin>
        <version.org.apache.maven.plugins.maven-war-plugin>2.4</version.org.apache.maven.plugins.maven-war-plugin>
        <version.org.codehaus.mojo.versions-maven-plugin>2.1</version.org.codehaus.mojo.versions-maven-plugin>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-assembly-plugin}</version>
                    <configuration>
                        <archive>
                            <index>true</index>
                            <manifest>
                                <addDefaultSpecificationEntries>
                                    true
                                </addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>
                                    true
                                </addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Implementation-URL>${project.url}</Implementation-URL>
                                <Java-Version>${java.version}</Java-Version>
                                <Java-Vendor>${java.vendor}</Java-Vendor>
                                <Os-Name>${os.name}</Os-Name>
                                <Os-Arch>${os.arch}</Os-Arch>
                                <Os-Version>${os.version}</Os-Version>
                                <Scm-Url>${project.scm.url}</Scm-Url>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-compiler-plugin}</version>
                    <configuration>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                        <source>${version.java}</source>
                        <target>${version.java}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-checkstyle-plugin}</version>
                    <dependencies>
                        <dependency>
                            <groupId>io.machinecode</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>${version.io.machinecode.checkstyle}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <configLocation>checkstyle/checkstyle.xml</configLocation>
                        <consoleOutput>true</consoleOutput>
                        <failsOnError>true</failsOnError>
                        <useFile/>
                    </configuration>
                    <executions>
                        <execution>
                            <id>check-style</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>checkstyle</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-dependency-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-ear-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-ear-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-ejb-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-ejb-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-failsafe-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-gpg-plugin}</version>
                    <configuration>
                        <useAgent>true</useAgent>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-help-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-help-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-jar-plugin}</version>
                    <configuration>
                        <archive>
                            <index>true</index>
                            <manifest>
                                <addDefaultSpecificationEntries>
                                    true
                                </addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>
                                    true
                                </addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Implementation-URL>${project.url}</Implementation-URL>
                                <Java-Version>${java.version}</Java-Version>
                                <Java-Vendor>${java.vendor}</Java-Vendor>
                                <Os-Name>${os.name}</Os-Name>
                                <Os-Arch>${os.arch}</Os-Arch>
                                <Os-Version>${os.version}</Os-Version>
                                <Scm-Url>${project.scm.url}</Scm-Url>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-javadoc-plugin}</version>
                    <executions>
                        <execution>
                            <id>prepare-javadoc</id>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>aggregate</goal>
                            </goals>
                            <configuration>
                                <quiet>true</quiet>
                                <!-- In case anyone needs to trace javadoc issues
                                <additionalJOption>-J-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</additionalJOption>
                                -->
                                <links>
                                    <link>http://docs.oracle.com/javase/8/docs/api/</link>
                                    <link>http://docs.oracle.com/javaee/7/docs/api/</link>
                                </links>
                            </configuration>
                        </execution>
                        <execution>
                            <id>attach-javadoc</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <header><![CDATA[<b>${project.name} ${project.version}</b>]]></header>
                        <footer><![CDATA[<b>${project.name} ${project.version}</b>]]></footer>
                        <archive>
                            <index>true</index>
                            <manifest>
                                <addDefaultSpecificationEntries>
                                    true
                                </addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>
                                    true
                                </addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Implementation-URL>${project.url}</Implementation-URL>
                                <Java-Version>${java.version}</Java-Version>
                                <Java-Vendor>${java.vendor}</Java-Vendor>
                                <Os-Name>${os.name}</Os-Name>
                                <Os-Arch>${os.arch}</Os-Arch>
                                <Os-Version>${os.version}</Os-Version>
                                <Scm-Url>${project.scm.url}</Scm-Url>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-resources-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-source-plugin}</version>
                    <configuration>
                        <archive>
                            <index>true</index>
                            <manifest>
                                <addDefaultSpecificationEntries>
                                    true
                                </addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>
                                    true
                                </addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Implementation-URL>${project.url}</Implementation-URL>
                            </manifestEntries>
                            <manifestSections>
                                <manifestSection>
                                    <name>Build-Information</name>
                                    <manifestEntries>
                                        <Java-Version>${java.version}</Java-Version>
                                        <Java-Vendor>${java.vendor}</Java-Vendor>
                                        <Os-Name>${os.name}</Os-Name>
                                        <Os-Arch>${os.arch}</Os-Arch>
                                        <Os-Version>${os.version}</Os-Version>
                                        <Scm-Url>${project.scm.url}</Scm-Url>
                                    </manifestEntries>
                                </manifestSection>
                            </manifestSections>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-surefire-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>${version.org.apache.maven.plugins.maven-war-plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${version.org.codehaus.mojo.versions-maven-plugin}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>snapshot</id>
            <activation>
                <property><name>snapshot</name></property>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <property><name>release</name></property>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <repository>
            <id>machinecode-repository</id>
            <name>MachineCode Repository</name>
            <url>${repository.machinecode.io}</url>
        </repository>
        <snapshotRepository>
            <id>machinecode-snapshot-repository</id>
            <name>MachineCode Snapshot Repository</name>
            <url>${snapshots.machinecode.io}</url>
        </snapshotRepository>
    </distributionManagement>
</project>
