<?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.jenkins-ci.plugins</groupId>
        <artifactId>github-integration-parent</artifactId>
        <version>0.1.0-rc25</version>
    </parent>

    <!-- historical name -->
    <artifactId>github-pullrequest</artifactId>
    <version>0.1.0-rc25</version>
    <packaging>hpi</packaging>

    <name>GitHub Integration Plugin</name>
    <description>GitHub Integration Plugin for Jenkins</description>
    <url>https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Integration+Plugin</url>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>KostyaSha</id>
            <name>Kanstantsin Shautsou</name>
            <timezone>UTC+3</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:ssh://github.com/KostyaSha/github-integration-plugin.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/KostyaSha/github-integration-plugin.git</developerConnection>
        <url>https://github.com/jenkinsci/github-integration-plugin</url>
        <tag>0.1.0-rc25</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven-release-plugin.version>2.5.1</maven-release-plugin.version>
        <maven-findbugs-plugin.version>3.0.2</maven-findbugs-plugin.version>
        <powermock.version>1.6.0</powermock.version>
        <logback.version>1.1.3</logback.version>
        <workflow.version>1.14</workflow.version>
        <matrix.version>1.6</matrix.version>
        <excluded.tests>**/its/*.java</excluded.tests>
        <java.level>8</java.level>
    </properties>

    <repositories>
        <repository>
            <id>repo.jenkins-ci.org</id>
            <url>https://repo.jenkins-ci.org/public/</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>repo.jenkins-ci.org</id>
            <url>https://repo.jenkins-ci.org/public/</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <!--main plugin deps-->
        <dependency>
            <groupId>com.coravy.hudson.plugins.github</groupId>
            <artifactId>github</artifactId>
            <version>1.22.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-jdk14</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>github-api</artifactId>
            <version>1.80</version>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>job-dsl</artifactId>
            <version>1.38</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>matrix-project</artifactId>
            <version>${matrix.version}</version>
        </dependency>

        <!--for publishers-->
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>email-ext</artifactId>
            <version>2.38.2</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>token-macro</artifactId>
            <version>1.10</version>
            <optional>true</optional>
        </dependency>

        <!-- blocked queue -->
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>block-queued-job</artifactId>
            <version>0.2.0</version>
            <optional>true</optional>
        </dependency>

        <!-- for pipeline/workflow step extension -->
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-step-api</artifactId>
            <version>${workflow.version}</version>
        </dependency>

        <!-- jucies -->
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>jucies</artifactId>
            <version>0.2.1</version>
            <optional>true</optional>
        </dependency>

        <!-- workflow for tests -->
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-job</artifactId>
            <version>${workflow.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-basic-steps</artifactId>
            <version>${workflow.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-durable-task-step</artifactId>
            <version>${workflow.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-cps</artifactId>
            <!-- see https://github.com/jenkinsci/workflow-cps-plugin/pull/7#issuecomment-216587074 -->
            <version>${workflow.version}-beta-1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>matrix-auth</artifactId>
            <version>1.4</version>
            <scope>test</scope>
        </dependency>

        <!--for tests-->
        <!-- Using 4.11, because 4.12 conflicts with PowerMock -->
        <!-- https://code.google.com/p/powermock/issues/detail?id=531 -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>1.10.5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-core</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- tests logging -->
        <!--<dependency>-->
            <!--<groupId>ch.qos.logback</groupId>-->
            <!--<artifactId>logback-core</artifactId>-->
            <!--<version>${logback.version}</version>-->
            <!--<scope>test</scope>-->
        <!--</dependency>-->

        <!--<dependency>-->
            <!--<groupId>ch.qos.logback</groupId>-->
            <!--<artifactId>logback-classic</artifactId>-->
            <!--<version>${logback.version}</version>-->
            <!--<scope>test</scope>-->
        <!--</dependency>-->

        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy</artifactId>
            <version>2.3.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.jayway.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <version>1.7.0</version>
            <scope>test</scope>
        </dependency>

        <!--to mock github-->
        <dependency>
            <groupId>com.github.tomakehurst</groupId>
            <artifactId>wiremock-standalone</artifactId>
            <version>2.2.1</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.mortbay.jetty</groupId>
                    <artifactId>jetty</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>xmlunit</groupId>
                    <artifactId>xmlunit</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.jayway.jsonpath</groupId>
                    <artifactId>json-path</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>net.sf.jopt-simple</groupId>
                    <artifactId>jopt-simple</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!--<dependency>-->
            <!--<groupId>xml-apis</groupId>-->
            <!--<artifactId>xml-apis</artifactId>-->
            <!--<version>1.4.01</version>-->
            <!--<scope>test</scope>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>com.coravy.hudson.plugins.github</groupId>-->
            <!--<artifactId>github</artifactId>-->
            <!--<version>1.21.1</version>-->
            <!--<classifier>test-jar</classifier>-->
            <!--<scope>test</scope>-->
        <!--</dependency>-->
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.${java.level}</source>
                    <target>1.${java.level}</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <excludes>
                        <exclude>InjectedTest.java</exclude>
                        <exclude>${excluded.tests}</exclude>
                    </excludes>
                    <rerunFailingTestsCount>2</rerunFailingTestsCount>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.6.201602180812</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>pre-integration-test</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>prepare-agent-integration</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report-integration</id>
                        <goals>
                            <goal>report-integration</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>github-its</id>
            <properties>
                <excluded.tests>none</excluded.tests>
            </properties>
        </profile>

        <profile>
            <id>gh-integration-analysers</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>2.17</version>
                        <executions>
                            <execution>
                                <id>validate</id>
                                <!--<phase>validate</phase>-->
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configLocation>src/test/resources/checkstyle/checkstyle.xml</configLocation>
                            <suppressionsLocation>src/test/resources/checkstyle/checkstyle-suppressions.xml
                            </suppressionsLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>false</failsOnError>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                        <version>${maven-findbugs-plugin.version}</version>
                        <configuration>
                            <effort>Max</effort>
                            <threshold>Low</threshold>
                            <xmlOutput>true</xmlOutput>
                            <failOnError>false</failOnError>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <version>3.6</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>check</goal>
                                    <goal>cpd-check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <failOnViolation>false</failOnViolation>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
