<!--
  #%L
  Gravia :: Integration Tests :: Karaf
  %%
  Copyright (C) 2010 - 2014 JBoss by Red Hat
  %%
  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%
  -->
  
<!--
    Set these VM properties in your IDE debugger
     
    -Dlog4j.configuration=file://${workspace_loc:gravia-itests-karaf}/src/test/resources/logging.properties
    -Dtarget.container=karaf
-->
<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.camel</groupId>
        <artifactId>compatibility-itests</artifactId>
        <version>3.3.0</version>
    </parent>

    <name>Compatibility :: Integration Tests :: Karaf</name>
    
    <artifactId>compatibility-itests-karaf</artifactId>
    
    <!-- Properties -->
    <properties>
        <karaf.home>${project.build.directory}/apache-karaf-${version.apache.karaf}</karaf.home>
    </properties>
    
    <dependencies>
        
        <!-- Provided Dependencies -->
        <dependency>
            <groupId>org.wildfly.camel</groupId>
	        <artifactId>compatibility-itests-common</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>org.jboss.arquillian.container</groupId>
            <artifactId>arquillian-container-karaf-managed</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.osgi</groupId>
            <artifactId>arquillian-osgi-bundle</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.enterprise</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

	<build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
		<plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-karaf</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.apache.karaf</groupId>
                                    <artifactId>apache-karaf</artifactId>
                                    <version>${version.apache.karaf}</version>
                                    <type>tar.gz</type>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                    <execution>
                        <id>unpack-karaf-patch</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.wildfly.camel</groupId>
                                    <artifactId>compatibility-patch-karaf</artifactId>
                                    <version>${project.version}</version>
                                    <type>tar.gz</type>
                                    <outputDirectory>${project.build.directory}/apache-karaf-${version.apache.karaf}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>${surefire.system.args}</argLine>
                    <redirectTestOutputToFile>false</redirectTestOutputToFile>
                    <reportNameSuffix>karaf</reportNameSuffix>
                    <dependenciesToScan>
                        <dependency>org.wildfly.camel:compatibility-itests-common</dependency>
                    </dependenciesToScan>
                    <systemPropertyVariables>
                        <log4j.configuration>file://${basedir}/src/test/resources/logging.properties</log4j.configuration>
                    </systemPropertyVariables>
                    <excludes>
                        <exclude>**/CDIIntegrationTest.class</exclude>
                        <exclude>**/SpringBeanTransformTest.class</exclude>
                    </excludes>
                </configuration>
            </plugin>
		</plugins>
	</build>
    
</project>
