<?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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>io.jooby</groupId>
  <artifactId>jooby-project</artifactId>
  <version>2.0.0.M1</version>
  <packaging>pom</packaging>

  <name>jooby-project</name>

  <description>The modular microframework for Java and Kotlin</description>

  <url>https://github.com/jooby-project/jooby</url>

  <properties>
    <!-- Parser and Renderer -->
    <freemarker.version>2.3.28</freemarker.version>
    <handlebars.version>4.1.2</handlebars.version>
    <jackson.version>2.9.6</jackson.version>

    <!-- hikari -->
    <HikariCP.version>3.2.0</HikariCP.version>
    <mysql-connector-java.version>8.0.13</mysql-connector-java.version>
    <log4jdbc.version>1.2</log4jdbc.version>
    <h2.version>1.4.197</h2.version>

    <!-- logging -->
    <logback-classic.version>1.2.3</logback-classic.version>
    <slf4j.version>1.7.25</slf4j.version>

    <!-- ASM -->
    <asm.version>7.0</asm.version>
    <commons-io.version>2.6</commons-io.version>

    <!-- Server -->
    <undertow.version>2.0.17.Final</undertow.version>

    <jetty.version>9.4.14.v20181114</jetty.version>

    <netty.version>4.1.33.Final</netty.version>
    <boringssl.version>2.0.8.Final</boringssl.version>

    <!-- Reactive -->
    <rxjava.version>2.2.5</rxjava.version>
    <reactor.version>3.2.5.RELEASE</reactor.version>

    <!-- Guice -->
    <guice.version>4.2.2</guice.version>

    <!-- Misc -->
    <okhttp.version>3.11.0</okhttp.version>

    <javassist.version>3.22.0-GA</javassist.version>
    <javax.inject.version>1</javax.inject.version>
    <jsr305.version>3.0.2</jsr305.version>
    <kotlin.version>1.3.20</kotlin.version>
    <kotlinx-coroutines-core.version>1.1.1</kotlinx-coroutines-core.version>

    <!-- Test dependencies -->
    <jacoco.version>0.8.2</jacoco.version>
    <junit.version>5.3.2</junit.version>
    <rest-assured.version>3.3.0</rest-assured.version>

    <!-- Gradle plugins -->
    <gradle-core.version>2.6</gradle-core.version>
    <gradle-plugins.version>0.9-rc-1</gradle-plugins.version>
    <gradle-tooling-api.version>2.6</gradle-tooling-api.version>

    <!-- Maven properties -->
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssa</maven.build.timestamp.format>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <timestamp>${maven.build.timestamp}</timestamp>

    <!-- Maven plugins -->
    <apt-maven-plugin.version>1.1.3</apt-maven-plugin.version>
    <archetype-packaging.version>2.2</archetype-packaging.version>
    <build-helper-maven-plugin.version>1.9.1</build-helper-maven-plugin.version>
    <capsule-maven-plugin.version>1.0.4</capsule-maven-plugin.version>
    <cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version>
    <coveralls-maven-plugin.version>3.1.0</coveralls-maven-plugin.version>
    <depencency-check-maven.version>2.1.1</depencency-check-maven.version>
    <docker-maven-plugin.version>0.4.13</docker-maven-plugin.version>
    <dokka-maven-plugin.version>0.9.13</dokka-maven-plugin.version>
    <duplicate-finder-maven-plugin.version>1.2.1</duplicate-finder-maven-plugin.version>
    <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
    <jacoco-maven-plugin.version>${jacoco.version}</jacoco-maven-plugin.version>
    <license-maven-plugin.version>3.0</license-maven-plugin.version>
    <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
    <maven-archetype-plugin.version>2.2</maven-archetype-plugin.version>
    <maven-assembly-plugin.version>3.1.0</maven-assembly-plugin.version>
    <maven-checkstyle-plugin.version>2.15</maven-checkstyle-plugin.version>
    <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
    <maven-core.version>3.5.4</maven-core.version>
    <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
    <maven-eclipse-plugin.version>2.9</maven-eclipse-plugin.version>
    <maven-enforcer-plugin.version>3.0.0-M1</maven-enforcer-plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <maven-jar-plugin.version>2.5</maven-jar-plugin.version>
    <maven-java-formatter-plugin.version>0.4</maven-java-formatter-plugin.version>
    <maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version>
    <maven-plugin-annotations.version>3.5.2</maven-plugin-annotations.version>
    <maven-plugin-api.version>3.5.4</maven-plugin-api.version>
    <maven-plugin-plugin.version>3.5</maven-plugin-plugin.version>
    <maven-project.version>2.2.1</maven-project.version>
    <maven-release-plugin.version>2.5.1</maven-release-plugin.version>
    <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
    <maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
    <maven-site-plugin.version>3.4</maven-site-plugin.version>
    <maven-source-plugin.version>2.4</maven-source-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M3</maven-surefire-plugin.version>
    <mojo-executor.version>2.3.0</mojo-executor.version>
    <nexus-staging-maven-plugin.version>1.6.5</nexus-staging-maven-plugin.version>
    <plexus-utils.version>3.1.0</plexus-utils.version>
    <stork-maven-plugin.version>2.7.0</stork-maven-plugin.version>
    <versions-maven-plugin.version>2.1</versions-maven-plugin.version>

    <!-- Gradle plugins -->
    <gradle-core.version>2.6</gradle-core.version>
    <gradle-plugins.version>0.9-rc-1</gradle-plugins.version>
    <gradle-tooling-api.version>2.6</gradle-tooling-api.version>

    <jooby.version>${project.version}</jooby.version>
    <jooby-maven-plugin.version>${jooby.version}</jooby-maven-plugin.version>
    <javadoc.excludes>io.jooby.internal</javadoc.excludes>
  </properties>

  <modules>
    <module>jooby</module>
    <module>modules</module>
    <module>examples</module>
    <module>tests</module>
    <module>docs</module>
  </modules>

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

  <developers>
    <developer>
      <id>jknack</id>
      <name>Edgar Espina</name>
      <url>https://github.com/jknack</url>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:jooby-project/jooby.git</connection>
    <developerConnection>scm:git:git@github.com:jooby-project/jooby.git</developerConnection>
    <url>scm:git:git@github.com:jooby-project/jooby.git</url>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <dependencyManagement>
    <dependencies>
      <!-- Jooby -->
      <dependency>
        <groupId>io.jooby</groupId>
        <artifactId>jooby</artifactId>
        <version>${jooby.version}</version>
      </dependency>

      <!-- server -->
      <dependency>
        <groupId>io.jooby</groupId>
        <artifactId>jooby-utow</artifactId>
        <version>${jooby.version}</version>
      </dependency>

      <dependency>
        <groupId>io.jooby</groupId>
        <artifactId>jooby-netty</artifactId>
        <version>${jooby.version}</version>
      </dependency>

      <dependency>
        <groupId>io.jooby</groupId>
        <artifactId>jooby-jetty</artifactId>
        <version>${jooby.version}</version>
      </dependency>

      <dependency>
        <groupId>io.jooby</groupId>
        <artifactId>jooby-jackson</artifactId>
        <version>${jooby.version}</version>
      </dependency>

      <dependency>
        <groupId>io.jooby</groupId>
        <artifactId>jooby-hikari</artifactId>
        <version>${jooby.version}</version>
      </dependency>

      <!-- ASM -->
      <dependency>
        <groupId>org.ow2.asm</groupId>
        <artifactId>asm</artifactId>
        <version>${asm.version}</version>
      </dependency>

      <dependency>
        <groupId>org.ow2.asm</groupId>
        <artifactId>asm-util</artifactId>
        <version>${asm.version}</version>
      </dependency>

      <!-- Jackson 2.x -->
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-jdk8</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-jsr310</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-parameter-names</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.dataformat</groupId>
        <artifactId>jackson-dataformat-yaml</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-kotlin</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-afterburner</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <!-- Freemarker -->
      <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>${freemarker.version}</version>
      </dependency>

      <!-- Handlebars -->
      <dependency>
        <groupId>com.github.jknack</groupId>
        <artifactId>handlebars</artifactId>
        <version>${handlebars.version}</version>
      </dependency>

      <!-- log4jdbc -->
      <dependency>
        <groupId>com.googlecode.log4jdbc</groupId>
        <artifactId>log4jdbc</artifactId>
        <version>${log4jdbc.version}</version>
      </dependency>

      <!-- Logging System -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>log4j-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jul-to-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

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

      <!-- commons-io -->
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commons-io.version}</version>
      </dependency>

      <!-- mySQL -->
      <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>${mysql-connector-java.version}</version>
      </dependency>

      <!-- h2 -->
      <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>${h2.version}</version>
      </dependency>

      <!-- javax.inject -->
      <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>${javax.inject.version}</version>
      </dependency>

      <!-- OKHttp -->
      <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>okhttp</artifactId>
        <version>${okhttp.version}</version>
      </dependency>

      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>${jsr305.version}</version>
      </dependency>

      <!-- Undertow -->
      <dependency>
        <groupId>io.undertow</groupId>
        <artifactId>undertow-core</artifactId>
        <version>${undertow.version}</version>
      </dependency>

      <!-- Jetty -->
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-server</artifactId>
        <version>${jetty.version}</version>
      </dependency>

      <dependency>
        <groupId>org.eclipse.jetty.websocket</groupId>
        <artifactId>websocket-server</artifactId>
        <version>${jetty.version}</version>
      </dependency>

      <!-- Netty -->
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-buffer</artifactId>
        <version>${netty.version}</version>
      </dependency>

      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-handler</artifactId>
        <version>${netty.version}</version>
      </dependency>

      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-transport-native-epoll</artifactId>
        <version>${netty.version}</version>
      </dependency>

      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-codec-http</artifactId>
        <version>${netty.version}</version>
      </dependency>

      <dependency>
        <groupId>org.javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>${javassist.version}</version>
      </dependency>

      <!-- rxjava -->
      <dependency>
        <groupId>io.reactivex.rxjava2</groupId>
        <artifactId>rxjava</artifactId>
        <version>${rxjava.version}</version>
      </dependency>

      <dependency>
        <groupId>io.rest-assured</groupId>
        <artifactId>rest-assured</artifactId>
        <version>${rest-assured.version}</version>
      </dependency>

      <!-- Hikari -->
      <dependency>
        <groupId>com.zaxxer</groupId>
        <artifactId>HikariCP</artifactId>
        <version>${HikariCP.version}</version>
      </dependency>

      <!-- reactor -->
      <dependency>
        <groupId>io.projectreactor</groupId>
        <artifactId>reactor-core</artifactId>
        <version>${reactor.version}</version>
      </dependency>

      <!-- Guice -->
      <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>${guice.version}</version>
      </dependency>

      <!-- Kotlin -->
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-stdlib</artifactId>
        <version>${kotlin.version}</version>
      </dependency>

      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-stdlib-jdk8</artifactId>
        <version>${kotlin.version}</version>
      </dependency>

      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-reflect</artifactId>
        <version>${kotlin.version}</version>
      </dependency>

      <dependency>
        <groupId>org.jetbrains.kotlinx</groupId>
        <artifactId>kotlinx-coroutines-core</artifactId>
        <version>${kotlinx-coroutines-core.version}</version>
      </dependency>

      <!-- Test dependencies -->
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${junit.version}</version>
      </dependency>

      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.jacoco</groupId>
        <artifactId>org.jacoco.agent</artifactId>
        <classifier>runtime</classifier>
        <version>${jacoco.version}</version>
        <scope>test</scope>
      </dependency>

      <!-- Maven -->
      <dependency>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>${exec-maven-plugin.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>${maven-plugin-api.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-project</artifactId>
        <version>${maven-project.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>${maven-core.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>${maven-plugin-annotations.version}</version>
      </dependency>

      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>${plexus-utils.version}</version>
      </dependency>

      <dependency>
        <groupId>org.twdata.maven</groupId>
        <artifactId>mojo-executor</artifactId>
        <version>${mojo-executor.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>${maven-antrun-plugin.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>

    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven-javadoc-plugin.version}</version>
      </plugin>

      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven-jar-plugin.version}</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <!-- version plugin -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <version>${versions-maven-plugin.version}</version>
      </plugin>

      <!-- sure-fire -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>

      <!-- Checkstyle -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven-checkstyle-plugin.version}</version>
        <configuration>
          <consoleOutput>true</consoleOutput>
          <configLocation>checkstyle.xml</configLocation>
          <failsOnError>true</failsOnError>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle</id>
            <phase>off</phase>
            <goals>
              <goal>checkstyle</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Deploy plugin -->
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>${nexus-staging-maven-plugin.version}</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${maven-deploy-plugin.version}</version>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <!-- kotlin -->
        <plugin>
          <artifactId>kotlin-maven-plugin</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
          <version>${kotlin.version}</version>
          <configuration>
            <args>
              <arg>-java-parameters</arg>
            </args>
            <jvmTarget>1.8</jvmTarget>
          </configuration>
          <executions>
            <execution>
              <id>compile</id>
              <goals>
                <goal>compile</goal>
              </goals>
            </execution>

            <execution>
              <id>test-compile</id>
              <goals>
                <goal>test-compile</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!-- shade -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>${maven-shade-plugin.version}</version>
          <configuration>
            <createDependencyReducedPom>false</createDependencyReducedPom>
            <filters>
              <filter>
                <artifact>*:*</artifact>
                <excludes>
                  <exclude>META-INF/*.SF</exclude>
                  <exclude>META-INF/*.DSA</exclude>
                  <exclude>META-INF/*.RSA</exclude>
                  <exclude>LICENSE</exclude>
                  <exclude>LICENSE.txt</exclude>
                  <exclude>NOTICE</exclude>
                  <exclude>about.html</exclude>
                  <exclude>jetty-dir.css</exclude>
                  <exclude>module-info.class</exclude>
                </excludes>
              </filter>
            </filters>
          </configuration>
          <executions>
            <execution>
              <id>fat-jar</id>
              <phase>package</phase>
              <goals>
                <goal>shade</goal>
              </goals>
              <configuration>
                <transformers>
                  <transformer
                      implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                  <transformer
                      implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                    <mainClass>${application.class}</mainClass>
                  </transformer>
                </transformers>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!-- ant plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>${maven-antrun-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.ant</groupId>
              <artifactId>ant</artifactId>
              <version>1.9.4</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.owasp</groupId>
          <artifactId>dependency-check-maven</artifactId>
          <version>${depencency-check-maven.version}</version>
          <configuration>
            <skipProvidedScope>true</skipProvidedScope>
            <skipRuntimeScope>true</skipRuntimeScope>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

  </build>

  <profiles>
    <profile>
      <id>bom</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.gmaven</groupId>
            <artifactId>groovy-maven-plugin</artifactId>
            <version>2.1</version>
            <inherited>false</inherited>
            <executions>
              <execution>
                <phase>generate-resources</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <source>modules/jooby-bom/bom.groovy</source>
            </configuration>
            <dependencies>
              <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-all</artifactId>
                <version>2.5.5</version>
                <type>pom</type>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <!-- We enable all these plugins by default. -->
      <id>development</id>
      <activation>
        <file>
          <exists>pom.xml</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <!-- Force maven-3.x and java-9 -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>${maven-enforcer-plugin.version}</version>
            <executions>
              <execution>
                <id>enforce-versions</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireMavenVersion>
                      <version>[3.5,)</version>
                    </requireMavenVersion>
                    <requireJavaVersion>
                      <version>[${maven.compiler.source},)</version>
                    </requireJavaVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven-compiler-plugin.version}</version>
            <configuration>
              <encoding>${project.build.sourceEncoding}</encoding>
              <compilerArgs>
                <arg>-parameters</arg>
              </compilerArgs>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>${maven-resources-plugin.version}</version>
          </plugin>

          <!-- Source code -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</version>
          </plugin>

          <!-- Surefire: unit test -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven-surefire-plugin.version}</version>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Hack for m2e(Eclipse)/IDEA -->
    <profile>
      <id>IDE</id>
      <dependencies>
        <!-- ASM -->
        <dependency>
          <groupId>org.ow2.asm</groupId>
          <artifactId>asm</artifactId>
          <optional>false</optional>
        </dependency>

        <dependency>
          <groupId>org.jooby</groupId>
          <artifactId>jooby-netty</artifactId>
        </dependency>

        <dependency>
          <groupId>org.jooby</groupId>
          <artifactId>jooby-jackson</artifactId>
        </dependency>

        <dependency>
          <groupId>com.fasterxml.jackson.module</groupId>
          <artifactId>jackson-module-kotlin</artifactId>
        </dependency>
      </dependencies>
    </profile>

    <!-- Sonatype OSS release -->
    <profile>
      <id>central</id>
      <build>
        <plugins>
          <!-- Source -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- Javadoc -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <configuration>
              <excludePackageNames>${javadoc.excludes}</excludePackageNames>
              <aggregate>true</aggregate>
              <show>public</show>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- GPG -->
          <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>
                <configuration>
                  <keyname>${gpg.keyname}</keyname>
                  <passphraseServerId>${gpg.keyname}</passphraseServerId>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!-- Release plugin -->
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${nexus-staging-maven-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
