<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>
  <packaging>war</packaging>

  <parent>
    <groupId>org.kie</groupId>
    <artifactId>kie-dmn</artifactId>
    <version>7.68.0.Final</version>
  </parent>

  <artifactId>kie-dmn-feel-gwt-showcase</artifactId>

  <name>KIE :: Decision Model Notation :: FEEL DMN GWT SHOWCASE</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.gwt.plugin.version>2.9.0</maven.gwt.plugin.version>
    <it.tests>**/*IT.java</it.tests>
    <!-- Version 2.0.1.Final which is coming from kie-parent is not compatible with validation components -->
    <version.javax.validation>1.0.0.GA</version.javax.validation>
    <!-- ERRAI webapp compatible -->
    <version.com.google.guava>29.0-jre</version.com.google.guava>
  </properties>

  <dependencies>

    <!-- FEEL -->
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-dmn-feel-gwt</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-dmn-feel-gwt</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-dmn-feel</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.eclipse.jdt</groupId>
          <artifactId>ecj</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-dmn-feel</artifactId>
      <classifier>sources</classifier>
      <exclusions>
        <exclusion>
          <groupId>org.eclipse.jdt</groupId>
          <artifactId>ecj</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.rikkola.gwt</groupId>
      <artifactId>antlr4-c3-gwt</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr4gwt-runtime</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Test -->
    <dependency>
      <groupId>io.github.bonigarcia</groupId>
      <artifactId>webdrivermanager</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- GWT -->
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-dev</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Logs -->
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
    </dependency>

    <!-- ERRAI + dependencies required by ERRAI -->
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-javaee-all</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-annotation-processors</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.ejb</groupId>
      <artifactId>jakarta.ejb-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.xml.bind</groupId>
      <artifactId>jakarta.xml.bind-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-gwt</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <classifier>sources</classifier>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.servlet</groupId>
      <artifactId>jakarta.servlet-api</artifactId>
    </dependency>
  </dependencies>

  <build>
    <finalName>${project.artifactId}</finalName>
    <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>${maven.gwt.plugin.version}</version>
        <configuration>
          <runTarget>index.html</runTarget>
          <extraJvmArgs>-Xmx1g -Xms756m -XX:CompileThreshold=1000</extraJvmArgs>
          <hostedWebapp>src/main/webapp/</hostedWebapp>
          <gwtSdkFirstInClasspath>false</gwtSdkFirstInClasspath>
          <disableCastChecking>true</disableCastChecking>
          <draftCompile>true</draftCompile>
          <logLevel>ERROR</logLevel>
          <strict>true</strict>
          <compileSourcesArtifacts>
            <compileSourcesArtifact>org.kie:kie-dmn-api</compileSourcesArtifact>
            <compileSourcesArtifact>org.kie:kie-dmn-feel</compileSourcesArtifact>
            <compileSourcesArtifact>org.kie:kie-dmn-feel-gwt</compileSourcesArtifact>
            <compileSourcesArtifact>org.kie:kie-dmn-model</compileSourcesArtifact>
          </compileSourcesArtifacts>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>resources</goal>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>gwt-clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <failOnMissingWebXml>false</failOnMissingWebXml>
          <warName>${project.artifactId}</warName>

          <!-- Exclude GWT client local classes from the deployment, lest 
            classpath scanners such as Hibernate and Weld get confused when the webapp 
            is bootstrapping. -->
          <packagingExcludes>**/javax/**/*.*,**/client/local/**/*.class</packagingExcludes>
          <warSourceExcludes>WEB-INF/web.xml</warSourceExcludes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>${basedir}</directory>
              <includes>
                <include>www-test/**</include>
                <include>.gwt/**</include>
                <include>.errai/**</include>
                <include>src/main/webapp/WEB-INF/deploy/**</include>
                <include>src/main/webapp/WEB-INF/lib/**</include>
                <include>src/main/webapp/FEELShowcaseWebapp/**</include>
                <include>**/*.JUnit/**</include>
                <include>monitordb.*</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <includes>
            <include>${it.tests}</include>
          </includes>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
