<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>com.github.mvp4g</groupId>
    <artifactId>mvp4g2-parent</artifactId>
    <version>1.0-beta-4</version>
  </parent>

  <artifactId>mvp4g2-processor</artifactId>
  <packaging>jar</packaging>
  <description>Model View Presenter with Event Bus For GWT 2 + 3 based on APT</description>

  <properties>
    <autocommon.version>0.8</autocommon.version>

    <mvp4g2.version>1.0-beta-4</mvp4g2.version>
    <autoservice.version>1.0-rc3</autoservice.version>
    <javapoet.version>1.10.0</javapoet.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.github.mvp4g</groupId>
      <artifactId>mvp4g2</artifactId>
      <version>${mvp4g2.version}</version>
    </dependency>

    <dependency>
      <groupId>com.google.auto.service</groupId>
      <artifactId>auto-service</artifactId>
      <version>${autoservice.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.squareup</groupId>
      <artifactId>javapoet</artifactId>
      <version>${javapoet.version}</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.testing.compile</groupId>
      <artifactId>compile-testing</artifactId>
      <version>0.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>colt</groupId>
      <artifactId>colt</artifactId>
      <version>1.2.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>


  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.1</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
          <showWarnings>true</showWarnings>
          <showDeprecation>true</showDeprecation>
          <meminitial>128m</meminitial>
          <maxmem>1024m</maxmem>
          <encoding>${project.build.sourceEncoding}</encoding>
          <compilerArgs>
            <compilerArgument>-Xlint:all</compilerArgument>
          </compilerArgs>
        </configuration>
        <executions>
          <execution>
            <id>process-annotations</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <proc>only</proc>
              <annotationProcessors>
                <annotationProcessor>com.google.auto.service.processor.AutoServiceProcessor</annotationProcessor>
              </annotationProcessors>
            </configuration>
          </execution>
          <execution>
            <id>default-compile</id> <!-- using an id of default-compile will override the default execution -->
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <compilerArgs>
                <arg>-proc:none</arg>
              </compilerArgs>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${plugin.version.surfire}</version>
            <executions>
              <execution>
                <id>unit-tests</id>
                <goals>
                  <goal>test</goal>
                </goals>
                <phase>test</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${plugin.version.gpg.maven}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${plugin.version.javadoc}</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>${plugin.version.source}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${plugin.version.nexus.staging}</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>site</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.github</groupId>
            <artifactId>site-maven-plugin</artifactId>
            <version>${plugin.version.github.site}</version>
            <configuration>
              <branch>refs/heads/site</branch>
              <message>Creating site for ${project.name} ${project.version}</message>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>site</goal>
                </goals>
                <phase>site</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>${plugin.version.project.info.report}</version>
            <reportSets>
              <reportSet>
                <reports>
                  <report>index</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${plugin.version.javadoc}</version>
            <configuration>
              <detectLinks>true</detectLinks>
              <links>
                <link>http://www.gwtproject.org/javadoc/latest/</link>
              </links>
              <!--<excludePackageNames>-->
              <!--org.jboss.gwt.elemento.processor:org.jboss.gwt.elemento.processor.context-->
              <!--</excludePackageNames>-->
            </configuration>
            <reportSets>
              <reportSet>
                <id>aggregate</id>
                <reports>
                  <report>aggregate</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
        </plugins>
      </reporting>
    </profile>
  </profiles>
</project>
