<!--
  #%L
  Fuse Patch :: Distro
  %%
  Copyright (C) 2015 Private
  %%
  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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.wildfly.extras.patch</groupId>
        <artifactId>fuse-patch-itests</artifactId>
        <version>2.2.2</version>
    </parent>

    <name>Fuse Patch :: Integration Tests :: JaxWS</name>

    <artifactId>fuse-patch-itests-jaxws</artifactId>

    <!-- Properties -->
    <properties>
        <jboss.home>${project.build.directory}/wildfly-${version.wildfly}</jboss.home>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>org.wildfly.extras.patch</groupId>
            <artifactId>fuse-patch-config</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wildfly.extras.patch</groupId>
            <artifactId>fuse-patch-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        
        <!-- Provided -->
        <dependency>
            <groupId>org.wildfly.extras.patch</groupId>
            <artifactId>fuse-patch-jaxws</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
            <type>war</type>
        </dependency>
        
        <!-- Test -->
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.gravia</groupId>
            <artifactId>gravia-resource</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wildfly.arquillian</groupId>
            <artifactId>wildfly-arquillian-container-managed</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.wildfly.build</groupId>
                <artifactId>wildfly-server-provisioning-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>server-provisioning</id>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <phase>process-test-sources</phase>
                        <configuration>
                            <config-file>src/test/resources/server-provisioning.xml</config-file>
                            <server-name>wildfly-${version.wildfly}</server-name>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-server-config</id>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <phase>process-test-sources</phase>
                        <configuration>
                            <outputDirectory>${jboss.home}/standalone/configuration</outputDirectory>
                            <overwrite>true</overwrite>
                            <resources>
                                <resource>
                                    <directory>src/test/resources/configuration</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>wildfly-start</id>
                        <goals>
                            <goal>start</goal>
                        </goals>
                        <phase>process-test-resources</phase>
                        <configuration>
                            <jbossHome>${jboss.home}</jbossHome>
                            <serverConfig>standalone-extra.xml</serverConfig>
                            <javaOpts>
                                <option>-Dfusepatch.repository=file://${jboss.home}/fusepatch/repository</option>
                                <option>-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n</option>
                            </javaOpts>
                        </configuration>
                    </execution>
                    <execution>
                        <id>deploy-archiva</id>
                        <goals>
                            <goal>deploy-artifact</goal>
                        </goals>
                        <phase>process-test-resources</phase>
                        <configuration>
                            <groupId>org.wildfly.extras.patch</groupId>
                            <artifactId>fuse-patch-jaxws</artifactId>
                            <version>${project.version}</version>
                            <type>war</type>
                        </configuration>
                    </execution>
                    <execution>
                        <id>wildfly-shutdown</id>
                        <goals>
                            <goal>shutdown</goal>
                        </goals>
                        <phase>post-integration-test</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <jboss.home>${jboss.home}</jboss.home>
                    </systemPropertyVariables>
                    <redirectTestOutputToFile>false</redirectTestOutputToFile>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
</project>
