<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>
    <groupId>org.kie.smoke</groupId>
    <artifactId>kie-wb-smoke-tests</artifactId>
    <version>6.4.0.Final</version>
  </parent>

  <artifactId>kie-wb-smoke-tests-main</artifactId>

  <name>KIE (Drools) Workbench Smoke Tests :: Main</name>
  <description>Integration smoke tests for KIE Workbench and KIE Drools Workbench</description>

  <properties>
    <app.name>kie-wb</app.name><!-- for tests to know if they are running against kie-wb or kie-drools-wb -->
  </properties>
  
  <dependencies>
    <!-- utilities -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <!-- deps for selenium smoke tests -->
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-support</artifactId>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-firefox-driver</artifactId>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-ie-driver</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>

    <!--  Stay with httpcomponents: it will save us pain (as opposed to changing from resteasy to cxf to cxf 3.0, etc. --> 
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>fluent-hc</artifactId>
    </dependency>

    <dependency>
      <groupId>org.guvnor</groupId>
      <artifactId>guvnor-rest-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.remote</groupId>
      <artifactId>kie-remote-client</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.hornetq</groupId>
          <artifactId>hornetq-jms-client</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-internal</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.remote</groupId>
      <artifactId>kie-remote-jaxb</artifactId>
    </dependency>

    <!--  JAXB/JSON --> 
    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-mapper-asl</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-core-asl</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-xc</artifactId>
    </dependency>
    <dependency>
      <groupId>dom4j</groupId>
      <artifactId>dom4j</artifactId>
    </dependency>
    <dependency>
      <!-- parsing HTML -->
      <groupId>org.jsoup</groupId>
      <artifactId>jsoup</artifactId>
    </dependency>

    <!-- test -->
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-kie-services</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>kie-ci</artifactId>
          <groupId>org.kie</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- REST -->
    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>jaxrs-api</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-net</groupId>
      <artifactId>commons-net</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- deps needed by Tomcat 7x and Tomcat 8x -->
    <dependency>
      <groupId>org.codehaus.btm</groupId>
      <artifactId>btm</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.btm</groupId>
      <artifactId>btm-tomcat55-lifecycle</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.spec.javax.transaction</groupId>
      <artifactId>jboss-transaction-api_1.1_spec</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-tomcat-integration</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.spec.javax.security.jacc</groupId>
      <artifactId>jboss-jacc-api_1.4_spec</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>false</filtering>
      </testResource>
      <testResource>
        <directory>src/test/filtered-resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.cargo</groupId>
          <artifactId>cargo-maven2-plugin</artifactId>
          <configuration>
            <container>
              <timeout>${container.startstop.timeout.millis}</timeout>
              <systemProperties>
                <!-- Fixes issue when Tomcat hangs during deployment due to insufficient amount of entropy.
                     The property specifies less secure source of entropy, which is fine for testing.
                     See https://wiki.apache.org/tomcat/HowTo/FasterStartUp#Entropy_Source for more info -->
                <java.security.egd>file:/dev/./urandom</java.security.egd>
              </systemProperties>
            </container>
            <configuration>
              <properties>
                <cargo.jvmargs>-Xmx1g -XX:MaxPermSize=512m</cargo.jvmargs>
              </properties>
            </configuration>
            <deployables>
              <deployable>
                <properties>
                  <context>${deployable.context}</context>
                </properties>
                <pingURL>${deployable.base.uri}</pingURL>
                <pingTimeout>${deployment.timeout.millis}</pingTimeout>
              </deployable>
            </deployables>
          </configuration>
          <executions>
            <execution>
              <id>start-container</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>start</goal>
              </goals>
            </execution>
            <execution>
              <id>stop-container</id>
              <phase>post-integration-test</phase>
              <goals>
                <goal>stop</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <configuration>
            <systemPropertyVariables>
              <deployable.base.uri>${deployable.base.uri}</deployable.base.uri>
            </systemPropertyVariables>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>kie-drools-wb</id>
      <properties>
        <deployable.groupId>org.kie</deployable.groupId>
        <deployable.artifactId>kie-drools-wb-distribution-wars</deployable.artifactId>
        <deployable.context>kie-drools-wb</deployable.context>
        <app.name>kie-drools-wb</app.name>
      </properties>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <configuration>
                <groups>org.kie.smoke.wb.category.KieDroolsWbSmoke</groups>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <profile>
      <id>kie-wb</id>
      <activation>
        <property>
          <name>full</name>
        </property>
      </activation>
      <properties>
        <deployable.groupId>org.kie</deployable.groupId>
        <deployable.artifactId>kie-wb-distribution-wars</deployable.artifactId>
        <deployable.context>kie-wb</deployable.context>
      </properties>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <configuration>
                <groups>org.kie.smoke.wb.category.KieWbSmoke</groups>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <profile>
      <!-- Enable selenium UI smoke tests to be run with Firefox.

           Example usage: mvn clean install -Pwildfly8,kie-wb,selenium (executes all default smoke tests + UI ones)
                          mvn clean install -Pwildfly8,kie-wb,selenium -Dit.test=LoginIntegrationTest (executes just one test)

           To use Internet Explorer see profile 'ie' -->
      <id>selenium</id>
      <activation>
        <property>
          <name>selenium</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <id>selenium-tests</id>
                <phase>integration-test</phase>
                <goals>
                  <goal>integration-test</goal>
                </goals>
                <configuration>
                  <groups>org.kie.smoke.wb.category.KieWbSeleniumSmoke</groups>
                  <systemPropertyVariables>
                    <!-- directory where screenshots taken by webdriver will be placed -->
                    <selenium.screenshots.dir>${project.build.directory}/screenshots</selenium.screenshots.dir>
                    <app.name>${app.name}</app.name>
                  </systemPropertyVariables>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    
    <profile>
      <!--  Enable selenium UI smoke tests to be run with Internet Explorer.
      Example usage: mvn clean install -Pwildfly8,kie-wb,selenium,ie -->
      <id>ie</id>
      <activation>
        <property>
          <name>ie</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin> <!-- Downloads and unzips IEDriverServer.exe and then sets the
            system property 'webdriver.ie.driver' needed to instantiate InternetExplorerDriver -->
            <groupId>com.lazerycode.selenium</groupId>
            <artifactId>driver-binary-downloader-maven-plugin</artifactId>
            <version>1.0.7</version>
            <configuration>
              <!-- Where to download zips with selenium binaries -->
              <downloadedZipFileDirectory>${java.io.tmpdir}/selenium_zips</downloadedZipFileDirectory>
              <!-- Where to unzip browser specific binaries (IEDriverServer.exe, chromedriver) -->
              <rootStandaloneServerDirectory>${project.build.directory}/selenium_binaries</rootStandaloneServerDirectory>
              <!-- Config specifying download urls / md5 hashes for selenium binaries -->
              <customRepositoryMap>${project.build.testOutputDirectory}/driver-binary-urls.xml</customRepositoryMap>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>selenium</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <!-- property to let the tests know which browser we're using -->
                <browser>ie</browser>
                <!-- The following maven property is set by driver-binary-downloader-maven-plugin.
                Copy it as system property for InternetExplorerDriver-->
                <webdriver.ie.driver>${webdriver.ie.driver}</webdriver.ie.driver>                
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>eap64</id>
      <properties>
        <!-- The EAP 6.4.x binary can't be anonymously downloaded due to license issues. It can be downloaded manually
             and for free (e.g. from http://www.jboss.org/products/eap/download/) and the zip location needs to be specified
             here or via system property when running the build (don't forget to use the `file://` prefix when
             referencing the zip from local filesystem). -->
        <eap64.download.url>valid-url-for-eap-6.4-zip-needs-to-be-specified-here-or-via-cmd-line</eap64.download.url>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.kie</groupId>
          <artifactId>kie-wb-distribution-wars</artifactId>
          <classifier>${eap64.deployable.classifier}</classifier>
          <type>war</type>
        </dependency>
        <dependency>
          <groupId>org.kie</groupId>
          <artifactId>kie-drools-wb-distribution-wars</artifactId>
          <classifier>${eap64.deployable.classifier}</classifier>
          <type>war</type>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <container>
                <!-- jboss74x works for now, but should be updated to jboss75x once Cargo supports EAP 6.4 -->
                <containerId>jboss74x</containerId>
                <type>installed</type>
                <zipUrlInstaller>
                  <url>${eap64.download.url}</url>
                </zipUrlInstaller>
              </container>
              <configuration>
                <properties>
                  <cargo.jboss.configuration>standalone-full</cargo.jboss.configuration>
                </properties>
                <configfiles>
                  <configfile>
                    <file>${project.build.testOutputDirectory}/eap-wildfly-shared/config</file>
                    <todir>configuration</todir>
                    <overwrite>true</overwrite>
                  </configfile>
                  <configfile>
                    <file>${project.build.testOutputDirectory}/ssl/server</file>
                    <todir>configuration/ssl</todir>
                    <overwrite>true</overwrite>
                  </configfile>
                </configfiles>
              </configuration>
              <deployables>
                <deployable>
                  <groupId>${deployable.groupId}</groupId>
                  <artifactId>${deployable.artifactId}</artifactId>
                  <classifier>${eap64.deployable.classifier}</classifier>
                  <type>war</type>
                </deployable>
              </deployables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>tomcat7</id>
      <activation>
        <property>
          <name>full</name>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.kie</groupId>
          <artifactId>kie-wb-distribution-wars</artifactId>
          <classifier>${tomcat7.deployable.classifier}</classifier>
          <type>war</type>
        </dependency>
        <dependency>
          <groupId>org.kie</groupId>
          <artifactId>kie-drools-wb-distribution-wars</artifactId>
          <classifier>${tomcat7.deployable.classifier}</classifier>
          <type>war</type>
        </dependency>
      </dependencies>
      <build>
        <pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <container>
                <containerId>tomcat7x</containerId>
                <type>installed</type>
                <artifactInstaller>
                  <groupId>org.apache.tomcat</groupId>
                  <artifactId>tomcat</artifactId>
                  <version>${version.tomcat7}</version>
                </artifactInstaller>
                <systemProperties>
                  <tomcat.home>${project.build.directory}/cargo/configurations/tomcat7x</tomcat.home>
                  <bitronix.tm.configuration>
                    ${project.build.directory}/cargo/configurations/tomcat7x/conf/btm-config.properties
                  </bitronix.tm.configuration>
                  <jbpm.tsr.jndi.lookup>java:comp/env/TransactionSynchronizationRegistry</jbpm.tsr.jndi.lookup>
                  <org.jboss.logging.provider>jdk</org.jboss.logging.provider>
                </systemProperties>
                <dependencies>
                  <dependency>
                    <groupId>org.codehaus.btm</groupId>
                    <artifactId>btm</artifactId>
                  </dependency>
                  <dependency>
                    <groupId>org.codehaus.btm</groupId>
                    <artifactId>btm-tomcat55-lifecycle</artifactId>
                  </dependency>
                  <dependency>
                    <groupId>com.h2database</groupId>
                    <artifactId>h2</artifactId>
                  </dependency>
                  <dependency>
                    <groupId>org.jboss.spec.javax.transaction</groupId>
                    <artifactId>jboss-transaction-api_1.1_spec</artifactId>
                  </dependency>
                  <dependency>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                  </dependency>
                  <dependency>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-jdk14</artifactId>
                  </dependency>
                  <dependency>
                    <groupId>org.kie</groupId>
                    <artifactId>kie-tomcat-integration</artifactId>
                  </dependency>
                  <dependency>
                    <groupId>org.jboss.spec.javax.security.jacc</groupId>
                    <artifactId>jboss-jacc-api_1.4_spec</artifactId>
                  </dependency>
                </dependencies>
              </container>
              <configuration>
                <configfiles>
                  <configfile>
                    <file>${project.build.testOutputDirectory}/tomcat-shared/config</file>
                    <todir>conf</todir>
                    <overwrite>true</overwrite>
                  </configfile>
                  <configfile>
                    <file>${project.build.testOutputDirectory}/tomcat7/config</file>
                    <todir>conf</todir>
                    <overwrite>true</overwrite>
                  </configfile>
                </configfiles>
              </configuration>
              <deployables>
                <deployable>
                  <groupId>${deployable.groupId}</groupId>
                  <artifactId>${deployable.artifactId}</artifactId>
                  <classifier>${tomcat7.deployable.classifier}</classifier>
                  <type>war</type>
                </deployable>
              </deployables>
            </configuration>
          </plugin>
          <plugin>
            <!-- Tomcat is not (yet?) configured with JMS, so exclude the JMS tests. -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <excludedGroups>org.kie.smoke.wb.category.JMSSmoke</excludedGroups>
            </configuration>
          </plugin>
        </plugins>
        </pluginManagement>
      </build>
    </profile>

    <profile>
      <id>tomcat8</id>
      <dependencies>
        <dependency>
          <groupId>org.kie</groupId>
          <artifactId>kie-wb-distribution-wars</artifactId>
          <classifier>${tomcat8.deployable.classifier}</classifier>
          <type>war</type>
        </dependency>
        <dependency>
          <groupId>org.kie</groupId>
          <artifactId>kie-drools-wb-distribution-wars</artifactId>
          <classifier>${tomcat8.deployable.classifier}</classifier>
          <type>war</type>
        </dependency>
      </dependencies>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.cargo</groupId>
              <artifactId>cargo-maven2-plugin</artifactId>
              <configuration>
                <container>
                  <containerId>tomcat8x</containerId>
                  <type>installed</type>
                  <artifactInstaller>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat</artifactId>
                    <version>${version.tomcat8}</version>
                  </artifactInstaller>
                  <systemProperties>
                    <tomcat.home>${project.build.directory}/cargo/configurations/tomcat8x</tomcat.home>
                    <bitronix.tm.configuration>
                      ${project.build.directory}/cargo/configurations/tomcat8x/conf/btm-config.properties
                    </bitronix.tm.configuration>
                    <jbpm.tsr.jndi.lookup>java:comp/env/TransactionSynchronizationRegistry</jbpm.tsr.jndi.lookup>
                    <org.jboss.logging.provider>jdk</org.jboss.logging.provider>
                  </systemProperties>
                  <dependencies>
                    <dependency>
                      <groupId>org.codehaus.btm</groupId>
                      <artifactId>btm</artifactId>
                    </dependency>
                    <dependency>
                      <groupId>org.codehaus.btm</groupId>
                      <artifactId>btm-tomcat55-lifecycle</artifactId>
                    </dependency>
                    <dependency>
                      <groupId>com.h2database</groupId>
                      <artifactId>h2</artifactId>
                    </dependency>
                    <dependency>
                      <groupId>org.jboss.spec.javax.transaction</groupId>
                      <artifactId>jboss-transaction-api_1.1_spec</artifactId>
                    </dependency>
                    <dependency>
                      <groupId>org.slf4j</groupId>
                      <artifactId>slf4j-api</artifactId>
                    </dependency>
                    <dependency>
                      <groupId>org.slf4j</groupId>
                      <artifactId>slf4j-jdk14</artifactId>
                    </dependency>
                    <dependency>
                      <groupId>org.kie</groupId>
                      <artifactId>kie-tomcat-integration</artifactId>
                    </dependency>
                    <dependency>
                      <groupId>org.jboss.spec.javax.security.jacc</groupId>
                      <artifactId>jboss-jacc-api_1.4_spec</artifactId>
                    </dependency>
                  </dependencies>
                </container>
                <configuration>
                  <configfiles>
                    <configfile>
                      <file>${project.build.testOutputDirectory}/tomcat-shared/config</file>
                      <todir>conf</todir>
                      <overwrite>true</overwrite>
                    </configfile>
                    <configfile>
                      <file>${project.build.testOutputDirectory}/tomcat8/config</file>
                      <todir>conf</todir>
                      <overwrite>true</overwrite>
                    </configfile>
                  </configfiles>
                </configuration>
                <deployables>
                  <deployable>
                    <groupId>${deployable.groupId}</groupId>
                    <artifactId>${deployable.artifactId}</artifactId>
                    <classifier>${tomcat8.deployable.classifier}</classifier>
                    <type>war</type>
                  </deployable>
                </deployables>
              </configuration>
            </plugin>
            <plugin>
              <!-- Tomcat is not (yet?) configured with JMS, so exclude the JMS tests. -->
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <configuration>
                <excludedGroups>org.kie.smoke.wb.category.JMSSmoke</excludedGroups>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <profile>
      <id>wildfly8</id>
      <dependencies>
        <dependency>
          <groupId>org.kie</groupId>
          <artifactId>kie-wb-distribution-wars</artifactId>
          <classifier>${wildfly8.deployable.classifier}</classifier>
          <type>war</type>
        </dependency>
        <dependency>
          <groupId>org.kie</groupId>
          <artifactId>kie-drools-wb-distribution-wars</artifactId>
          <classifier>${wildfly8.deployable.classifier}</classifier>
          <type>war</type>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <container>
                <containerId>wildfly8x</containerId>
                <type>installed</type>
                <artifactInstaller>
                  <groupId>org.wildfly</groupId>
                  <artifactId>wildfly-dist</artifactId>
                  <version>${version.wildfly8}</version>
                </artifactInstaller>
              </container>
              <configuration>
                <properties>
                  <cargo.jboss.configuration>standalone-full</cargo.jboss.configuration>
                </properties>
                <configfiles>
                  <configfile>
                    <file>${project.build.testOutputDirectory}/eap-wildfly-shared/config</file>
                    <todir>configuration</todir>
                    <overwrite>true</overwrite>
                  </configfile>
                  <configfile>
                    <file>${project.build.testOutputDirectory}/ssl/server</file>
                    <todir>configuration/ssl</todir>
                    <overwrite>true</overwrite>
                  </configfile>
                </configfiles>
              </configuration>
              <deployables>
                <deployable>
                  <groupId>${deployable.groupId}</groupId>
                  <artifactId>${deployable.artifactId}</artifactId>
                  <classifier>${wildfly8.deployable.classifier}</classifier>
                  <type>war</type>
                </deployable>
              </deployables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>wildfly9</id>
      <dependencies>
        <dependency>
          <groupId>org.kie</groupId>
          <artifactId>kie-wb-distribution-wars</artifactId>
          <classifier>${wildfly8.deployable.classifier}</classifier>
          <type>war</type>
        </dependency>
        <dependency>
          <groupId>org.kie</groupId>
          <artifactId>kie-drools-wb-distribution-wars</artifactId>
          <classifier>${wildfly8.deployable.classifier}</classifier>
          <type>war</type>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <container>
                <containerId>wildfly9x</containerId>
                <type>installed</type>
                <artifactInstaller>
                  <groupId>org.wildfly</groupId>
                  <artifactId>wildfly-dist</artifactId>
                  <version>${version.wildfly9}</version>
                </artifactInstaller>
              </container>
              <configuration>
                <properties>
                  <cargo.jboss.configuration>standalone-full</cargo.jboss.configuration>
                </properties>
                <configfiles>
                  <configfile>
                    <file>${project.build.testOutputDirectory}/eap-wildfly-shared/config</file>
                    <todir>configuration</todir>
                    <overwrite>true</overwrite>
                  </configfile>
                  <configfile>
                    <file>${project.build.testOutputDirectory}/ssl/server</file>
                    <todir>configuration/ssl</todir>
                    <overwrite>true</overwrite>
                  </configfile>
                </configfiles>
              </configuration>
              <deployables>
                <deployable>
                  <groupId>${deployable.groupId}</groupId>
                  <artifactId>${deployable.artifactId}</artifactId>
                  <classifier>${wildfly8.deplyoble.classifier}</classifier>
                  <type>war</type>
                </deployable>
              </deployables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!-- Tests are disabled by default. They run with "full" build (e.g. mvn clean install -Dfull) -->
    <profile>
      <id>disable-cargo-and-tests</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <executions>
              <execution>
                <id>start-container</id>
                <phase>none</phase>
                <!-- do nothing, container is not managed by Cargo! -->
                <goals/>
              </execution>
              <execution>
                <id>stop-container</id>
                <phase>none</phase>
                <!-- do nothing, container is not managed by Cargo! -->
                <goals/>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <skipITs>true</skipITs>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- This profile basically disables any Cargo related execution, but runs the tests. It can be used when the tests
         should run on a container that has already been started and it is not managed by Cargo. It can also be used
         when doing a "no-test" build, as the container should not be used in that case. -->
    <profile>
      <id>custom-container</id>
      <activation>
        <property>
          <name>custom-container</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <executions>
              <execution>
                <id>start-container</id>
                <phase>none</phase>
                <!-- do nothing, container is not managed by Cargo! -->
                <goals/>
              </execution>
              <execution>
                <id>stop-container</id>
                <phase>none</phase>
                <!-- do nothing, container is not managed by Cargo! -->
                <goals/>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <skipITs>false</skipITs>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>full</id>
      <activation>
        <property>
          <name>full</name>
        </property>
      </activation>

      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <configuration>
                <skipITs>false</skipITs>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

</project>
