<?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>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.10.RELEASE</version>
        <relativePath/>
        <!-- lookup parent from repository -->
    </parent>

    <groupId>com.cooldatasoft</groupId>
    <artifactId>cds-parent</artifactId>
    <version>1.1.2.1510</version>
    <packaging>pom</packaging>

    <name>cds-parent</name>
    <description>Parent project for Cooldatasoft projects</description>
    <url>https://github.com/cooldatasoft/cds-parent</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Fatih Mehmet UCAR</name>
            <email>fmucar@cooldatasoft.com</email>
            <organization>Cooldatasoft</organization>
            <organizationUrl>http://www.cooldatasoft.com</organizationUrl>
        </developer>
    </developers>


    <scm>
        <connection>scm:git:git://github.com/cooldatasoft/cds-parent.git</connection>
        <developerConnection>scm:git:ssh://github.com:cooldatasoft/cds-parent.git</developerConnection>
        <url>http://github.com/cooldatasoft/cds-parent/tree/master</url>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>


        <!--********* Dependency Versions *********-->
        <cds-build-tools.version>1.1.2</cds-build-tools.version>

        <build-tools.groupId>com.cooldatasoft</build-tools.groupId>
        <build-tools.artifactId>cds-build-tools</build-tools.artifactId>
        <build-tools.version>${cds-build-tools.version}</build-tools.version>

        <!--********* CheckStyle *********-->
        <checkstyle.version>8.8</checkstyle.version>
        <checkstyle.config.location>checkstyle/checkstyle-rules.xml</checkstyle.config.location>
        <checkstyle.suppressions.location>checkstyle/checkstyle-suppressions.xml</checkstyle.suppressions.location>

        <!--********* FINDBUGS *********-->
        <maven.findbugs.detail>high</maven.findbugs.detail>
        <maven.findbugs.failOnError>false</maven.findbugs.failOnError>
        <maven.findbugs.xmlOutput>true</maven.findbugs.xmlOutput>
        <maven.findbugs.threashold>Low</maven.findbugs.threashold>
        <maven.findbugs.effort>Max</maven.findbugs.effort>


        <!--********* Plugin Versions *********-->
        <maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
        <maven-pmd-plugin.version>3.9.0</maven-pmd-plugin.version>
        <findbugs-maven-plugin.version>3.0.5</findbugs-maven-plugin.version>
        <maven-javadoc-plugin.version>3.0.0</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.20.1</maven-surefire-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>


        <!--CPD check limit-->
        <minimumTokens>200</minimumTokens>
    </properties>


    <build>

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>


        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${maven-checkstyle-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>${build-tools.groupId}</groupId>
                            <artifactId>${build-tools.artifactId}</artifactId>
                            <version>${build-tools.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>${checkstyle.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>checkstyle</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <configuration>
                                <consoleOutput>true</consoleOutput>
                                <failOnViolation>true</failOnViolation>
                                <failsOnError>true</failsOnError>
                                <encoding>UTF-8</encoding>
                                <failsOnError>false</failsOnError>
                                <includeTestSourceDirectory>true</includeTestSourceDirectory>
                                <outputFile>${project.build.directory}/checkstyle/result.xml</outputFile>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>${maven-pmd-plugin.version}</version>
                    <configuration>
                        <printFailingErrors>true</printFailingErrors>
                        <failOnViolation>true</failOnViolation>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                                <goal>cpd-check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>${build-tools.groupId}</groupId>
                            <artifactId>${build-tools.artifactId}</artifactId>
                            <version>${build-tools.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>${findbugs-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>analyze</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <includeTests>true</includeTests>
                        <failOnError>false</failOnError>
                        <findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>CucumberTests</id>
                            <phase>test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <includes>
                                    <include>**/*WebRunnerSuite*.class</include>
                                </includes>
                                <testFailureIgnore>true</testFailureIgnore>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <configuration>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <failOnViolation>true</failOnViolation>
                    <failsOnError>true</failsOnError>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${maven-pmd-plugin.version}</version>
                <!--<configuration>
                    <rulesets>
                        <ruleset>pmd/pmd-ruleset.xml</ruleset>
                    </rulesets>
                </configuration>-->
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>${findbugs-maven-plugin.version}</version>
                <configuration>
                    <excludeFilterFile>findbugs/findbugs-exclude.xml</excludeFilterFile>
                    <failOnError>true</failOnError>
                    <findbugsXmlOutput>true</findbugsXmlOutput>
                    <xmlOutput>true</xmlOutput>
                    <xmlOutputDirectory>target/site</xmlOutputDirectory>
                </configuration>
            </plugin>

        </plugins>
    </reporting>
</project>