<?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>com.fitbur</groupId>
    <artifactId>base</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>
     
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.version>3.0.4</maven.version>
        
        <!-- Metadata -->
        <meta.package>com.fitbur</meta.package>
        <meta.path>com/fitbur</meta.path>
        
        <!-- Netbeans Hints -->
        <netbeans.hint.license>apache20</netbeans.hint.license>
        <netbeans.checkstyle.format>true</netbeans.checkstyle.format>
        <netbeans.compile.on.save>none</netbeans.compile.on.save>
        
        <!-- Dependencies -->
        <slf4j.version>1.7.5</slf4j.version>        
        <testng.version>6.8.8</testng.version>
        <logback.version>1.0.13</logback.version>
        <log4j.version>1.2.17</log4j.version>
        <jansi.version>1.11</jansi.version>
        <hk2.version>2.3.0</hk2.version>
        <guava.version>16.0.1</guava.version>
        <jsr305.version>2.0.3</jsr305.version>
        <checkerframework.version>1.8.3</checkerframework.version>

        <!-- Plugins -->
        <plugin.compile>3.1</plugin.compile>
        <plugin.surefire>2.17</plugin.surefire>
        <plugn.failsafe>2.17</plugn.failsafe>
        <plugin.enforcer>1.3.1</plugin.enforcer>
        <plugin.hk2>2.3.0</plugin.hk2>
        <plugin.checkstyle>2.12</plugin.checkstyle>
        <plugin.jacoco>0.7.1.201405082137</plugin.jacoco>
        <plugin.pit>1.0.0</plugin.pit>
        <plugin.checkerframework>1.8.2</plugin.checkerframework>
        <plugin.source>2.3</plugin.source>
        <plugin.javadoc>2.9.1</plugin.javadoc>
        <plugin.dependency>2.8</plugin.dependency>
        <plugin.nexus.staging>1.6.4</plugin.nexus.staging>
        <plugin.pgp>1.5</plugin.pgp>
    </properties>
    
    <name>Fitbur Base</name>
    <description>Base POM for FitburIO Modules</description>
    <url>http://www.github.com/FitburIO/base</url>
    <inceptionYear>2014</inceptionYear>

    <organization>
        <name>Fitbur, Inc.</name>
        <url>http://www.github.com/FitburIO</url>
    </organization>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <comments>Copyright 2014 Sharmarke Aden</comments>
            <distribution>repo</distribution>
        </license>
    </licenses>
    
    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/FitburIO/base/issues</url>
    </issueManagement>
    
    <scm>
        <url>https://github.com/FitburIO/base</url>
        <connection>scm:git:git@github.com:FitburIO/framework.git</connection>
        <developerConnection>scm:git:git@github.com:FitburIO/framework.git</developerConnection>
    </scm>
    
    <developers>
        <developer>
            <id>saden1</id>
            <name>Sharmare Aden</name>
            <email>saden1@gmail.com</email>
            <url>http://www.github.com/saden1</url>
            <organization>Fitrbur</organization>
            <organizationUrl>http://www.github.com/FitburIO</organizationUrl>
            <timezone>-8</timezone>
            <roles>
                <role>Founder</role>
            </roles>
        </developer>
    </developers>
    
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish.hk2</groupId>
                <artifactId>hk2-api</artifactId>
                <version>${hk2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.checkerframework</groupId>
                <artifactId>checker-qual</artifactId>
                <version>${checkerframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    
    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.checkerframework</groupId>
            <artifactId>checker-qual</artifactId>
        </dependency> 
        <dependency>
            <groupId>org.glassfish.hk2</groupId>
            <artifactId>hk2-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.glassfish.hk2</groupId>
                <artifactId>hk2-inhabitant-generator</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${plugin.enforcer}</version>
                    <executions>
                        <execution>
                            <id>enforce-versions</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireMavenVersion>
                                        <version>[${maven.version},)</version>
                                    </requireMavenVersion>
                                    <requireJavaVersion>
                                        <version>${maven.compiler.target}</version>
                                    </requireJavaVersion>
                                    <requireProperty>
                                        <property>project.build.sourceEncoding</property>
                                        <regex>${project.build.sourceEncoding}</regex>
                                    </requireProperty>
                                    <bannedDependencies>
                                        <excludes>
                                            <exclude>log4j:log4j</exclude>
                                            <exclude>commons-logging:commons-logging</exclude>
                                            <exclude>junit:junit</exclude>
                                            <exclude>org.slf4j:slf4j-log4j12</exclude>
                                            <exclude>org.slf4j:slf4j-jcl</exclude>
                                            <exclude>org.slf4j:slf4j-jdk14</exclude>
                                        </excludes>
                                    </bannedDependencies>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${plugin.compile}</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <compilerArguments>
                            <endorseddirs>${endorsed.dir}</endorseddirs>
                            <parameters/>
                        </compilerArguments>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${plugin.dependency}</version>
                </plugin>
                <plugin>
                    <groupId>org.checkerframework</groupId>
                    <artifactId>checkerframework-maven-plugin</artifactId>
                    <version>${plugin.checkerframework}</version>
                    <executions>
                        <execution>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <processors>
                            <processor>org.checkerframework.checker.nullness.NullnessChecker</processor>
                            <processor>org.checkerframework.checker.interning.InterningChecker</processor>
                            <processor>org.checkerframework.checker.formatter.FormatterChecker</processor>
                            <processor>org.checkerframework.checker.igj.IGJChecker</processor>
                        </processors>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${plugin.surefire}</version>
                    <configuration>
                        <argLine>-Xms512m -Xmx1024m ${argLine}</argLine>
                        <parallel>classes</parallel>
                        <includes>
                            <include>**/*Test.java</include>
                        </includes>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${plugn.failsafe}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <parallel>classes</parallel>
                        <includes>
                            <include>**/*IT.java</include>
                        </includes>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${plugin.source}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${plugin.javadoc}</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <resourcesArtifacts>
                            <!--                            <resourcesArtifact>
                                <groupId>com.fitbur</groupId>
                                <artifactId>build-resources</artifactId>
                                <version>1.0</version>
                            </resourcesArtifact>-->
                        </resourcesArtifacts>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.glassfish.hk2</groupId>
                    <artifactId>hk2-inhabitant-generator</artifactId>
                    <version>${plugin.hk2}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generate-inhabitants</goal>
                                <goal>generate-test-inhabitants</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${plugin.jacoco}</version>
                    <executions>
                        <execution>
                            <id>prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>jacoco-report</id>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>check</id>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <rule>
                                        <element>BUNDLE</element>
                                        <limits>
                                            <limit>
                                                <counter>COMPLEXITY</counter>
                                                <value>COVEREDRATIO</value>
                                                <minimum>60</minimum>
                                            </limit>
                                        </limits>
                                    </rule>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                    <configuration>
                        <haltOnFailure>false</haltOnFailure>
                        <includes>
                            <include>${meta.path}/**/*.*</include>
                        </includes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.pitest</groupId>
                    <artifactId>pitest-maven</artifactId>
                    <version>${plugin.pit}</version>
                    <executions>
                        <execution>
                            <id>pit-report</id>
                            <goals>
                                <goal>mutationCoverage</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <failWhenNoMutations>false</failWhenNoMutations>
                        <threads>4</threads>
                        <historyInputLocation>${project.build.directory/pit.history</historyInputLocation>
                        <historyOutputLocation>${project.build.directory/pit.history</historyOutputLocation>
                        <targetClasses>
                            <param>${meta.package}*</param>
                        </targetClasses>
                        <targetTests>
                            <param>${meta.package}*</param>
                        </targetTests>
                        <exportLineCoverage>true</exportLineCoverage>
                        <outputFormats>
                            <outputFormat>HTML</outputFormat>
                            <outputFormat>XML</outputFormat>
                        </outputFormats>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${plugin.pgp}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${plugin.nexus.staging}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${plugin.checkstyle}</version>
                <configuration>
                    <configLocation>config/sun_checks.xml</configLocation>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
    
    <profiles>
        <profile>
            <id>integ</id>
            <build> 
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build> 
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    
</project>
