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

  <groupId>net.ltgt.gwt.maven</groupId>
  <artifactId>gwt-maven-plugin</artifactId>
  <version>1.0.0</version>
  <packaging>maven-plugin</packaging>

  <name>Maven Plugin for GWT</name>
  <description>Starting fresh on building GWT projects with Maven</description>
  <url>https://tbroyer.github.io/gwt-maven-plugin/</url>

  <inceptionYear>2012</inceptionYear>
  <licenses>
    <license>
      <name>Apache 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Thomas Broyer</name>
      <email>t.broyer@ltgt.net</email>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/tbroyer/gwt-maven-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:tbroyer/gwt-maven-plugin.git</developerConnection>
    <url>https://github.com/tbroyer/gwt-maven-plugin</url>
    <tag>1.0.0</tag>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/tbroyer/gwt-maven-plugin/issues</url>
  </issueManagement>
  <distributionManagement>
    <site>
      <id>github-ssh</id>
      <url>gitsite:git@github.com/tbroyer/gwt-maven-plugin.git</url>
    </site>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <prerequisites>
    <maven>${mavenVersion}</maven>
  </prerequisites>

  <repositories>
    <repository>
      <id>google-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/google-snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <properties>
    <mavenVersion>3.3.1</mavenVersion>
    <targetJdk>7</targetJdk>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.outputEncoding>UTF-8</project.build.outputEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <gwtVersion>2.8.2</gwtVersion>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.5.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.sonatype.plexus</groupId>
      <artifactId>plexus-build-api</artifactId>
      <version>0.0.7</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-archiver</artifactId>
      <version>3.6.0</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>3.1.0</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-compiler-api</artifactId>
      <version>2.8.5</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-archiver</artifactId>
      <version>3.2.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.surefire</groupId>
      <artifactId>maven-surefire-common</artifactId>
      <version>2.22.1</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-plugin-descriptor</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-project</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-toolchain</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Some artifacts used by invoker tests, declared here so they're resolved early -->
    <!-- Actually because invoker plugin cannot install snapshots through extraArtifacts -->
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>${gwtVersion}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <version>${gwtVersion}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-servlet</artifactId>
      <version>${gwtVersion}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <source>${targetJdk}</source>
          <target>${targetJdk}</target>
          <proc>none</proc><!-- maven-plugin-api bring's in an annotation processor that generates warnings -->
          <showDeprecation>true</showDeprecation>
          <showWarnings>true</showWarnings>
          <compilerArgs>
            <arg>-Xlint:all</arg>
            <arg>-Xlint:-options</arg><!-- disable warning about cross-compilation when building with JDK 8 -->
            <arg>-Werror</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.5.2</version>
        <configuration>
          <goalPrefix>gwt</goalPrefix>
        </configuration>
        <executions>
          <execution>
            <id>help-mojo</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
          <execution>
            <id>default-descriptor</id>
            <phase>process-classes</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <goals>
              <goal>install</goal>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <cloneProjectsTo>${project.build.directory}/it-tests</cloneProjectsTo>
          <localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
          <settingsFile>src/it/settings.xml</settingsFile>
          <filterProperties>
            <gwtVersion>${gwtVersion}</gwtVersion>
          </filterProperties>
          <extraArtifacts>
            <artifact>org.apache.maven.plugins:maven-compiler-plugin:3.8.0:maven-plugin</artifact>
            <artifact>org.apache.maven.plugins:maven-source-plugin:3.0.1:maven-plugin</artifact>
            <artifact>org.codehaus.mojo:build-helper-maven-plugin:3.0.0:maven-plugin</artifact>
            <artifact>org.codehaus.gmaven:groovy-maven-plugin:2.0:maven-plugin</artifact>
            <artifact>com.google.guava:guava:19.0</artifact>
            <artifact>com.google.guava:guava-gwt:19.0</artifact>
            <artifact>com.google.auto.value:auto-value:1.6.2</artifact>
            <artifact>com.google.auto.value:auto-value-annotations:1.6.2</artifact>
            <artifact>javax.servlet:servlet-api:2.5</artifact>
            <artifact>junit:junit:4.12</artifact>
          </extraArtifacts>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.7.1</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.doxia</groupId>
            <artifactId>doxia-module-markdown</artifactId>
            <version>1.8</version>
          </dependency>
          <dependency>
            <groupId>com.github.stephenc.wagon</groupId>
            <artifactId>wagon-gitsite</artifactId>
            <version>0.5</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.8</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-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy site-deploy</goals>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.5.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>jdk9plus</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <release>${targetJdk}</release>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <additionalOptions>
                <option>-html5</option>
              </additionalOptions>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.4.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>enforce</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>[9,)</version>
                </requireJavaVersion>
                <requireReleaseDeps />
                <requireNoRepositories>
                  <allowSnapshotRepositories>true</allowSnapshotRepositories>
                </requireNoRepositories>
              </rules>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
