<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
~ Copyright 2012 Red Hat, Inc. and/or its affiliates.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~       http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
--><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>

  <parent>
    <groupId>org.kie</groupId>
    <artifactId>kie-wb-distributions</artifactId>
    <version>7.32.0.Final</version>
  </parent>

  <artifactId>business-central-parent</artifactId>

  <packaging>pom</packaging>
  <name>Business Central Parent</name>
  <description>Business Central Parent</description>

  <modules>
    <module>business-central-webapp-common</module>
    <module>business-central-deployment-validation</module>
    <module>business-central-theme</module>
    <module>business-monitoring-webapp</module>
    <module>business-central-webapp</module>
    <module>business-central-distribution-wars</module>
  </modules>

  <properties>
    <!-- Add the absolute path for $JBOSS_HOME below to manage another instance -->
    <errai.jboss.home>${project.build.directory}/wildfly-${version.org.jboss.errai.wildfly}</errai.jboss.home>
    <gwt.compiler.localWorkers>1</gwt.compiler.localWorkers>
    <gwt.memory.settings>-Xmx6g -Xms1g -Xss1M</gwt.memory.settings>
    <login.bundle.name>org.kie.bc.client.resources.i18n.LoginConstants</login.bundle.name>
    <login.page>kie-wb.jsp</login.page>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <!-- Default configuration used for FastCompiled build. Includes the common GWT source artifacts and plugin
               config. Product X community specific artifacts (e.g. home page) are specified using
               profiles "productized" and "notProductized".

               Keep the configuration here (pluginManagement) instead of directly in <plugins>. -->
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>gwt-maven-plugin</artifactId>
          <configuration>
            <deploy>${project.build.directory}/gwt-symbols-deploy</deploy>
            <localWorkers>${gwt.compiler.localWorkers}</localWorkers>
            <extraJvmArgs>${gwt.memory.settings} -XX:CompileThreshold=7000 -Derrai.jboss.home=${errai.jboss.home} -Derrai.server.classOutput=${project.build.outputDirectory} -Derrai.dynamic_validation.enabled=true -Dorg.kie.demo=true -Dorg.kie.clean.onstartup=true -Dorg.uberfire.nio.git.ssh.enabled=true -Djava.util.prefs.syncInterval=2000000 -Dorg.uberfire.async.executor.safemode=true -Derrai.marshalling.very_short_names=${errai.marshalling.very_short_names} -Dappformer.experimental.features=true</extraJvmArgs>
            <draftCompile>true</draftCompile>
            <module>org.kie.bc.FastCompiledKIEWebapp</module>
            <logLevel>INFO</logLevel>
            <noServer>false</noServer>
            <server>org.jboss.errai.cdi.server.gwt.EmbeddedWildFlyLauncher</server>
            <disableCastChecking>true</disableCastChecking>
            <runTarget>kie-wb.jsp</runTarget>
          </configuration>
          <executions>
            <execution>
              <id>gwt-clean</id>
              <phase>clean</phase>
              <goals>
                <goal>clean</goal>
              </goals>
            </execution>
            <execution>
              <id>gwt-compile</id>
              <goals>
                <!-- Do not use 'resources' goal as it does not play well with resource filtering and is adding Java
                     source files into the build output directory (and they then end up in the WAR). -->
                <goal>compile</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <configuration>
            <filesets>
              <fileset>
                <directory>${basedir}</directory>
                <includes>
                  <include>src/main/webapp/org.kie.bc.KIEWebapp/</include>
                  <include>src/main/webapp/WEB-INF/deploy/</include>
                  <include>src/main/webapp/WEB-INF/classes/</include>
                  <include>src/main/webapp/WEB-INF/lib/</include>
                  <include>src/main/webapp/WEB-INF/tlds/</include>
                  <include>repositories/</include>
                  <include>.errai/</include>
                  <include>.niogit/**</include>
                  <include>.index/**</include>
                </includes>
              </fileset>
            </filesets>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <executions>
            <execution>
              <id>copy-resources</id>
              <phase>process-resources</phase>
              <goals>
                <goal>copy-resources</goal>
              </goals>
              <configuration>
                <outputDirectory>${errai.jboss.home}/standalone/configuration</outputDirectory>
                <overwrite>true</overwrite>
                <resources>
                  <resource>
                    <directory>src/main/config</directory>
                    <filtering>false</filtering>
                  </resource>
                </resources>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <executions>
            <execution>
              <id>unpack</id>
              <phase>process-resources</phase>
              <goals>
                <goal>unpack</goal>
              </goals>
              <configuration>
                <artifactItems>
                  <artifactItem>
                    <groupId>org.jboss.errai</groupId>
                    <artifactId>wildfly-dist</artifactId>
                    <version>${version.org.jboss.errai.wildfly}</version>
                    <type>zip</type>
                    <overWrite>false</overWrite>
                    <outputDirectory>${project.build.directory}</outputDirectory>
                  </artifactItem>
                </artifactItems>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>io.thorntail</groupId>
          <artifactId>thorntail-maven-plugin</artifactId>
          <configuration>
            <fractionDetectMode>never</fractionDetectMode>
            <fractions>
              <fraction>logging</fraction>
              <fraction>undertow</fraction>
              <fraction>cdi</fraction>
              <fraction>ejb</fraction>
              <fraction>jaxrs</fraction>
              <fraction>ee</fraction>
              <fraction>security</fraction>
              <fraction>management</fraction>
              <fraction>datasources</fraction>
            </fractions>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>package</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

  </build>

  <profiles>
    <!-- Community Home Page -->
    <profile>
      <id>notProductizedProfile</id>
      <activation>
        <property>
          <name>!productized</name>
        </property>
      </activation>
      <modules>
        <module>business-central-home-page-community</module>
        <module>jbpm-server-distribution</module>
        <module>add-ons-distribution</module>
      </modules>

      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>gwt-maven-plugin</artifactId>
              <configuration>
                <compileSourcesArtifacts combine.children="append">
                  <!-- Community Theme -->
                  <compileSourcesArtifact>org.kie:business-central-theme-community</compileSourcesArtifact>
                  <!-- Community Home Page -->
                  <compileSourcesArtifact>org.kie:business-central-home-page-community</compileSourcesArtifact>
                  <compileSourcesArtifact>org.kie.workbench.screens:kie-wb-common-home-api</compileSourcesArtifact>
                  <compileSourcesArtifact>org.kie.workbench.screens:kie-wb-common-home-client</compileSourcesArtifact>
                </compileSourcesArtifacts>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <!-- Product Home Page -->
    <profile>
      <id>productizedProfile</id>
      <activation>
        <property>
          <name>productized</name>
        </property>
      </activation>
      <modules>
        <module>business-central-home-page-product</module>
      </modules>

      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>gwt-maven-plugin</artifactId>
              <configuration>
                <compileSourcesArtifacts combine.children="append">
                  <!-- Product Theme -->
                  <compileSourcesArtifact>org.kie:business-central-theme-product</compileSourcesArtifact>
                  <!-- Product Home Page -->
                  <compileSourcesArtifact>org.kie:business-central-home-page-product</compileSourcesArtifact>
                  <compileSourcesArtifact>org.kie.workbench.screens:kie-wb-common-home-api</compileSourcesArtifact>
                  <compileSourcesArtifact>org.kie.workbench.screens:kie-wb-common-home-client</compileSourcesArtifact>
                </compileSourcesArtifacts>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <!-- Full profile builds all GWT permutations -->
    <profile>
      <id>fullProfile</id>
      <activation>
        <property>
          <name>full</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>gwt-maven-plugin</artifactId>
              <configuration>
                <module>org.kie.bc.KIEWebapp</module>
                <draftCompile>false</draftCompile>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

  </profiles>

</project>
