<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  Fuse EAP :: Testsuite :: Standalone
  %%
  Copyright (C) 2015 RedHat
  %%
  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.
  #L%
  -->

<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>com.redhat.fuse.eap</groupId>
        <artifactId>fuse-eap-itests-standalone</artifactId>
        <version>6.3.0.redhat-511</version>
    </parent>

    <name>Fuse EAP :: Testsuite :: Standalone :: Examples</name>

    <artifactId>fuse-eap-itests-standalone-examples</artifactId>

    <!-- Dependencies -->
    <dependencies>
        <dependency>
            <groupId>org.wildfly.camel</groupId>
            <artifactId>wildfly-camel-itests-common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.camel</groupId>
            <artifactId>wildfly-camel-itests-standalone-basic</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.camel</groupId>
            <artifactId>wildfly-camel-itests-standalone-smoke</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.camel</groupId>
            <artifactId>wildfly-camel-example-itests</artifactId>
        </dependency>
        
        <!-- Test -->
        <dependency>
            <groupId>org.wildfly.camel</groupId>
            <artifactId>wildfly-camel-testenricher</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jvnet.mock-javamail</groupId>
            <artifactId>mock-javamail</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.picketlink</groupId>
            <artifactId>picketlink-federation</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                       <id>unpack-wildfly</id>
                       <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.jboss.as</groupId>
                                    <artifactId>jboss-as-dist</artifactId>
                                    <version>${version.wildfly}</version>
                                    <type>zip</type>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${target.dir}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-eap-installer</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.redhat.fuse.eap</groupId>
                                    <artifactId>fuse-eap-installer</artifactId>
                                    <version>${project.version}</version>
                                    <outputDirectory>${jboss.home}</outputDirectory>
                                    <destFileName>fuse-eap-installer.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-wfc-example-deps</id>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeGroupIds>com.icegreen,org.apache.activemq,org.wildfly.camel</includeGroupIds>
                            <includeTypes>rar,war</includeTypes>
                            <stripVersion>true</stripVersion>
                            <outputDirectory>${target.dir}/examples</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-user-properties</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${jboss.home}</outputDirectory>
                            <overwrite>true</overwrite>
                            <resources>
                                <resource>
                                    <directory>etc/jboss-eap</directory>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>run-fuse-eap-installer</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>java</executable>
                            <arguments>
                                <argument>-jar</argument>
                                <argument>${jboss.home}/fuse-eap-installer.jar</argument>
                                <argument>${jboss.home}</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <redirectTestOutputToFile>false</redirectTestOutputToFile>
                    <environmentVariables>
                        <JBOSS_HOME>${jboss.home}</JBOSS_HOME>
                        <SWITCHYARD_VERSION>${version.switchyard}</SWITCHYARD_VERSION>
                    </environmentVariables>
                    <systemPropertyVariables>
                        <jboss.home>${jboss.home}</jboss.home>
                    </systemPropertyVariables>
                    <dependenciesToScan>
                        <dependency>org.wildfly.camel:wildfly-camel-itests-standalone-smoke</dependency>
                        <dependency>org.wildfly.camel:wildfly-camel-itests-standalone-basic</dependency>
                        <dependency>org.wildfly.camel:wildfly-camel-example-itests</dependency>
                    </dependenciesToScan>
                    <excludes>
                        <!-- [ENTESB-6651] Fix MailIntegrationTest in Fuse-6.3 -->
                        <exclude>org/wildfly/camel/test/mail/MailIntegrationTest.*</exclude>
                        <!-- [ENTESB-11010] FileCharset tests fail on fuse-eap-6.3 -->
                        <exclude>org/wildfly/camel/test/smoke/FileCharsetTest.*</exclude>
                        <exclude>org/wildfly/camel/test/spring/SpringFileCharsetTest.*</exclude>
                        <!-- [ENTESB-11011] ActiveMQIntegrationTest fails on fuse-eap-6.3 -->
                        <exclude>org/wildfly/camel/test/activemq/ActiveMQIntegrationTest.*</exclude>
                        <!-- [ENTESB-11012] SftpIntegrationTest fails on fuse-eap-6.3 -->
                        <exclude>org/wildfly/camel/test/ftp/SftpIntegrationTest.*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>groovy-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>modules-check</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <properties>
                                <!-- [TODO] Fail the build where duplicate module dependencies are detected -->
                                <failonerror>false</failonerror>
                            </properties>
                            <source>${project.basedir}/scripts/module-checker.groovy</source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jboss.shrinkwrap.resolver</groupId>
                <artifactId>shrinkwrap-resolver-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>propagate-execution-context</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>aix</id>
            <activation>
                <os>
                    <name>AIX</name>
                </os>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <!-- [ENTESB-6651] Fix MailIntegrationTest in Fuse-6.3 -->
                                <exclude>org/wildfly/camel/test/mail/MailIntegrationTest.*</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
