<?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.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <name>GitHub Event API Server</name>

    <url>https://github.com/Shredder121/gh-event-api</url>
    <description>A Server that bootstraps custom handlers for the GitHub Event API</description>

    <groupId>com.github.shredder121</groupId>
    <artifactId>gh-event-api</artifactId>
    <version>0.3</version>
    <packaging>jar</packaging>

    <organization>
        <name>Shredder121</name>
        <url>https://github.com/Shredder121</url>
    </organization>

    <scm>
        <connection>scm:git:git@github.com:Shredder121/gh-event-api.git</connection>
        <developerConnection>scm:git:git@github.com:Shredder121/gh-event-api.git</developerConnection>
        <url>https://github.com/Shredder121/gh-event-api.git</url>
    </scm>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <lombok.version>1.16.6</lombok.version>

        <spring.boot.version>1.3.0.RELEASE</spring.boot.version>
        <surefire.version>2.18.1</surefire.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-guava</artifactId>
            <version>2.6.3</version>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- test dependencies -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.jayway.restassured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>2.7.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.kohsuke</groupId>
            <artifactId>github-api</artifactId>
            <version>1.71</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring.boot.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <classifier>full</classifier>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.3</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>sonatype-nexus-staging</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                </configuration>
            </plugin>

            <!-- Test Plugins -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire.version}</version>
                <configuration>
                    <disableXmlReport>true</disableXmlReport>
                    <printSummary>false</printSummary>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>4.0.0</version>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.5.201505241946</version>
                <configuration>
                    <excludes>
                        <mainClass>com/github/shredder121/gh_event_api/GHEventApiServer.class</mainClass>
                        <mixins>com/github/shredder121/gh_event_api/model/json/*</mixins>
                        <innerClass>com/github/shredder121/gh_event_api/filter/GithubMACChecker$*</innerClass>

                        <!-- Only an informational filter -->
                        <filter>com/github/shredder121/gh_event_api/filter/GithubMDCInsertingServletFilter.class</filter>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok-maven-plugin</artifactId>
                    <version>1.16.6.1</version>
                    <executions>
                        <execution>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>delombok</goal>
                            </goals>
                            <configuration>
                                <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                                <addOutputDirectory>false</addOutputDirectory>
                                <formatPreferences>
                                    <javaLangAsFQN>skip</javaLangAsFQN>
                                </formatPreferences>
                            </configuration>
                        </execution>
                    </executions>

                    <dependencies>
                        <dependency>
                            <groupId>sun.jdk</groupId>
                            <artifactId>tools</artifactId>
                            <version>1.6</version>
                            <scope>system</scope>
                            <systemPath>${java.home}/../lib/tools.jar</systemPath>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.1</version>
                    <configuration>
                        <sourcepath>${project.build.directory}/generated-sources/delombok</sourcepath>
                        <groups>
                            <group>
                                <title>Main entry point</title>
                                <packages>com.github.shredder121.gh_event_api</packages>
                            </group>
                            <group>
                                <title>API Endpoints</title>
                                <packages>com.github.shredder121.gh_event_api.controller*</packages>
                            </group>
                            <group>
                                <title>Handlers</title>
                                <packages>com.github.shredder121.gh_event_api.handler*</packages>
                            </group>
                            <group>
                                <title>Model</title>
                                <packages>com.github.shredder121.gh_event_api.model*</packages>
                            </group>
                        </groups>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <developers>
        <developer>
            <id>Shredder121</id>
            <name>Ruben Dijkstra</name>
        </developer>
    </developers>

    <profiles>
        <profile>
            <id>sonatype-oss-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>
