<!--
  #%L
  Gravia :: Runtime :: Embedded
  %%
  Copyright (C) 2013 - 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=${workspace_loc:gravia-runtime-embedded}/src/test/resources/logging.properties
-->
<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.jboss.gravia</groupId>
        <artifactId>gravia-runtime</artifactId>
        <version>1.1.0.Beta20</version>
    </parent>

    <name>Gravia :: Runtime :: Embedded</name>
    
    <artifactId>gravia-runtime-embedded</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.jboss.gravia</groupId>
            <artifactId>gravia-resource</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.gravia</groupId>
            <artifactId>gravia-runtime-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.configadmin</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.metatype</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.enterprise</artifactId>
        </dependency>
        
        <!-- Provided Dependencies -->
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.ant</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.ds-annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.http.bridge</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.http.proxy</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        
        <!-- Test Dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

	<build>
		<plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>bundles</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>directory-single</goal>
                        </goals>
                        <configuration>
                            <finalName>test-libs</finalName>
                            <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>scripts/assembly-bundles.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
			<plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>scr-descriptor</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <property name="project.version" value="${project.version}" />
                                <property name="version.scr" value="${version.apache.felix.scr}" />
                                <property name="version.scr.ant" value="${version.apache.felix.scr.generator}" />
                                <property name="version.ds.annotations" value="${version.apache.felix.scr.ds.annotations}" />
                                <property name="version.osgi" value="${version.osgi}" />
                                <ant antfile="scripts/antrun-scr-plugin.xml" target="generate" />
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--
             All processing of test components 
             https://issues.apache.org/jira/browse/FELIX-4271 
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
                <executions>
                    <execution>
                        <id>scrdescriptor</id>
                        <goals>
                            <goal>scr</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                            <specVersion>1.2</specVersion>
                            <strictMode>true</strictMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            -->
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<argLine>${surefire.system.args}</argLine>
					<systemPropertyVariables>
                        <basedir>${basedir}</basedir>
                        <log4j.configuration>file://${basedir}/src/test/resources/logging.properties</log4j.configuration>
					</systemPropertyVariables>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
