<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.trustedanalytics</groupId>
    <artifactId>spring-project-template</artifactId>
    <packaging>pom</packaging>
    <version>0.5.0</version>
    <name>Spring Boot Parent POM</name>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.2.2.RELEASE</version>
    </parent>

    <properties>
        <java.version>1.8</java.version>

        <skip-jacoco>false</skip-jacoco>
        <skip-jacoco-check>false</skip-jacoco-check>
        <jacoco-measurement-instructions>0</jacoco-measurement-instructions>
        <jacoco-measurement-branches>0</jacoco-measurement-branches>
        <jacoco-measurement-lines>0</jacoco-measurement-lines>
        <jacoco-measurement-classes>0</jacoco-measurement-classes>

        <repository.snapshot.id>snapshots</repository.snapshot.id>
        <repository.snapshot.name>SnapshotRepository</repository.snapshot.name>
        <repository.snapshot.url>file:///${user.home}/.m2/snapshots</repository.snapshot.url>
        
        <git-repository>spring-project-template-placeholder</git-repository>

        <repository.release.id>releases</repository.release.id>
        <repository.release.name>ReleaseRepository</repository.release.name>
        <repository.release.url>file:///${user.home}/.m2/releases</repository.release.url>
        <hadoop.version>2.6.0-cdh5.5.1</hadoop.version>
    </properties>

    <scm>
        <connection>scm:git:git@${artifactId}:${git-repository}</connection>
        <tag>HEAD</tag>
    </scm>

    <repositories>
        <repository>
            <id>cloudera</id>
            <name>Cloudera Repository</name>
            <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Repository Milestones</name>
            <url>http://maven.springframework.org/milestone/</url>
        </repository>
        <repository>
            <id>spring-releases</id>
            <name>Spring Repository Releases</name>
            <url>http://maven.springframework.org/release/</url>
        </repository>
    </repositories>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <header>license/license_header_2016.txt</header>
		    <validHeaders>
		        <validHeader>license/license_header_2015.txt</validHeader>
		        <validHeader>license/license_header_2016.txt</validHeader>
		    </validHeaders>
                    <includes>
                        <include>src/**/*.java</include>
                        <include>src/**/*.html</include>
                        <include>tools/*.sh</include>
                        <include>license_checker/*.sh</include>
                        <include>license/*.sh</include>
			<include>pack.sh</include>
                    </includes>
                    <mapping>
                        <java>JAVADOC_STYLE</java>
                        <sh>SCRIPT_STYLE</sh>
                        <html>XML_STYLE</html>
                    </mapping>
                </configuration>
                <executions>
                    <execution>
                        <id>check-license</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.4.201502262128</version>
                <configuration>
                    <skip>${skip-jacoco}</skip>
                    <destFile>${basedir}/target/coverage-reports/jacoco-unit.exec</destFile>
                    <dataFile>${basedir}/target/coverage-reports/jacoco-unit.exec</dataFile>
                </configuration>
                <executions>
                    <execution>
                        <id>jacoco-initialize</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-site</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-check</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <skip>${skip-jacoco-check}</skip>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit>
                                            <counter>INSTRUCTION</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco-measurement-instructions}</minimum>
                                        </limit>
                                        <limit>
                                            <counter>BRANCH</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco-measurement-branches}</minimum>
                                        </limit>
                                        <limit>
                                            <counter>LINE</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco-measurement-lines}</minimum>
                                        </limit>
                                        <limit>
                                            <counter>CLASS</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco-measurement-classes}</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.1</version>
                <executions>
                    <execution>
                        <id>javadoc</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>${repository.snapshot.id}</id>
            <name>${repository.snapshot.name}</name>
            <url>${repository.snapshot.url}</url>
        </snapshotRepository>

        <repository>
            <id>${repository.release.id}</id>
            <name>${repository.release.name}</name>
            <url>${repository.release.url}</url>
        </repository>
    </distributionManagement>

</project>
