<?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>
    <artifactId>gwt-material-parent</artifactId>
    <groupId>com.github.gwtmaterialdesign</groupId>
    <version>2.4.2</version>
  </parent>

  <artifactId>gwt-material-table</artifactId>
  <packaging>gwt-lib</packaging>
  <version>${parent.version}</version>

  <name>Gwt Material Table</name>
  <description>A complex table component designed for the material design specifications</description>
  <url>http://gwtmaterialdesign.github.io/gwt-material-table/</url>
  <developers>
    <developer>
      <name>Ben Dol</name>
      <email>dolb90@gmail.com</email>
      <organization>Gwt Material</organization>
      <organizationUrl>http://gwtmaterialdesign.github.io/gwt-material/</organizationUrl>
    </developer>
  </developers>

  <repositories>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
    </repository>
    <repository>
      <id>sonatype-nexus-snapshot</id>
      <name>Sonatype Nexus snapshot repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>snapshots-repo</id>
      <!--<url>https://oss.sonatype.org/content/repositories/google-snapshots</url>-->
      <url>https://oss.sonatype.org/content/repositories/public/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <properties>
    <!-- Project properties -->
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.encoding>UTF-8</project.encoding>
    <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
    <!-- Plugin Versions -->
    <maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
    <maven-compiler-plugin.version>3.2</maven-compiler-plugin.version>
    <maven.failsafe.plugin>2.22.1</maven.failsafe.plugin>
  </properties>

  <licenses>
    <license>
      <name>Apache License Version 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
    </license>
  </licenses>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <name>Sonatype Nexus snapshot repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Sonatype Nexus release repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <dependencies>
    <!-- GwtMaterial -->
    <dependency>
      <groupId>com.github.gwtmaterialdesign</groupId>
      <artifactId>gwt-material</artifactId>
      <version>${parent.version}</version>
    </dependency>

    <dependency>
      <groupId>com.github.gwtmaterialdesign</groupId>
      <artifactId>gwt-material-jquery</artifactId>
      <version>${parent.version}</version>
    </dependency>

    <!-- GWT -->
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>${gwt.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.htmlunit</groupId>
      <artifactId>htmlunit</artifactId>
      <version>${htmlunit.version}</version>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/java</directory>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire.version}</version>
        <configuration>
          <excludes>
            <exclude>**/**.java</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <!--
        The integration-test phase runs after regular test phase (but before verify/install).
        We use this to our advantage to peak at the compiled output from the GWTTestSuite
         -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${maven.failsafe.plugin}</version>
        <configuration>
          <includes>
            <include>**/*.class</include>
          </includes>
        </configuration>
      </plugin>

      <plugin>
        <!--
		The integration-test phase runs after regular test phase (but before verify/install).
		We use this to our advantage to peak at the compiled output from the GWTTestSuite
		 -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${maven.failsafe.plugin}</version>
        <configuration>
          <includes>
            <include>**/*.class</include>
          </includes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>net.ltgt.gwt.maven</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>${tbroyer.version}</version>
        <extensions>true</extensions>
        <configuration>
          <moduleName>gwt.material.design.GwtMaterialTable</moduleName>
          <style>OBFUSCATED</style>
          <logLevel>INFO</logLevel>
          <sourceLevel>1.8</sourceLevel>
          <jvmArgs>
            <jvmArg>-Xmx1g</jvmArg>
            <jvmArg>-Xms1g</jvmArg>
            <jvmArg>-XX:CompileThreshold=7000</jvmArg>
          </jvmArgs>
          <optimize>9</optimize>
          <compilerArgs>
            <compilerArg>-compileReport</compilerArg>
            <compilerArg>-XcompilerMetrics</compilerArg>
          </compilerArgs>
          <skipModule>true</skipModule>
          <classpathScope>compile+runtime</classpathScope>
          <failOnError>true</failOnError>
        </configuration>
        <executions>
          <execution>
            <id>compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>default-test</id>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <!--
			  Because we expressly disable asserts in tests to avoid a compiler bug, we also must run surefire manually
			  on the JRE tests
			   -->
              <excludes>
                <exclude>**/ui/**.java</exclude>
              </excludes>
              <includes>
                <include>**/DataTableTestSuite.java</include>
              </includes>

              <!-- disable JVM asserts, but enable JS asserts for tests -->
              <enableAssertions>false</enableAssertions>
              <testArgs>
                <testArg>-checkAssertions</testArg>
              </testArgs>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>
