<?xml version="1.0" encoding="UTF-8"?>
<!--
 - Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors.
 - 
 - 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">
    <parent>
        <groupId>org.switchyard</groupId>
        <artifactId>switchyard-as7-openshift-express-parent</artifactId>
        <version>2.0.1.redhat-621216</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>switchyard-as7-openshift-express-dist</artifactId>
    <packaging>jar</packaging>
    <name>SwitchYard: AS7 OpenShift Express Distribution</name>
    <description>SwitchYard AS7 OpenShift Express Distribution</description>
    <properties>
        <staging.dir>${project.build.directory}/jboss-switchyard</staging.dir>
        <staging.jboss.dir>${staging.dir}/jboss-as-${version.jbossas.openshift}</staging.jboss.dir>
        <distro.root.dir>/switchyard-as7-${version.distro}/</distro.root.dir>
        <switchyard.jboss.home>${project.build.directory}${distro.root.dir}</switchyard.jboss.home>
    </properties>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>stage-jboss</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.jboss.as</groupId>
                                    <artifactId>jboss-as-dist</artifactId>
                                    <type>zip</type>
                                </artifactItem>
                            </artifactItems>
                            <!-- Comment when using JBossWS stack
                            <excludes>**/javax/xml/soap/api/**,**/javax/xml/ws/api/**,**/org/apache/cxf/**,**/org/apache/ws/**,**/org/jboss/as/messaging/**,**/org/jboss/as/webservices/**,**/org/jboss/ws/**,**/org/jboss/osgi/**</excludes>-->
                            <!-- Uncomment when using JBossWS stack -->
                            <excludes>**/org/jboss/as/messaging/**,**/org/jboss/osgi/**</excludes>
                            <outputDirectory>${staging.dir}</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>install-switchyard-cartridge</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.switchyard</groupId>
                                    <artifactId>switchyard-as7-openshift-express-cartridge</artifactId>
                                    <type>tar.gz</type>
                                    <version>${project.version}</version>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${staging.jboss.dir}</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>install-distribution-files</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.switchyard</groupId>
                                    <artifactId>switchyard-release-distribution</artifactId>
                                    <type>jar</type>
                                    <version>${project.version}</version>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${staging.jboss.dir}</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>unzip-distro</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.switchyard</groupId>
                                    <artifactId>switchyard-as7-openshift-express-dist</artifactId>
                                    <type>zip</type>
                                    <version>${project.version}</version>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>unpack-tests</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.switchyard</groupId>
                                    <artifactId>switchyard-as7-tests</artifactId>
                                    <type>test-jar</type>
                                    <version>${project.version}</version>
                                </artifactItem>
                            </artifactItems>
                            <excludes>**/*/CamelJMSBindingQuickstartTest.class, **/*/HornetqBindingQuickstartTest.class, **/*/BpelServiceJmsBindingQuickstartTest.class, **/*/JCA*HornetQQuickstartTest.class, **/*/PolicyTransactionDemoQuickstartTest.class</excludes>
                            <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <appendAssemblyId>false</appendAssemblyId>
                            <finalName>switchyard-as7-openshift-express</finalName>
                            <descriptors>
                                <descriptor>${basedir}/assembly.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Configure the Surefire plugin for running the tests.  Be sure to make these same setting if running in your IDE... -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <environmentVariables>
                        <JBOSS_HOME>${switchyard.jboss.home}</JBOSS_HOME>
                        <SWITCHYARD_VERSION>${project.version}</SWITCHYARD_VERSION>
                    </environmentVariables>
                    <systemProperties>
                        <property>
                            <name>jboss.home</name>
                            <value>${switchyard.jboss.home}</value>
                        </property>
                        <property>
                            <name>module.path</name>
                            <value>${switchyard.jboss.home}/modules</value>
                        </property>
                    </systemProperties>
                    <trimStackTrace>false</trimStackTrace>
                    <printSummary>true</printSummary>
                    <forkMode>always</forkMode>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
