<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jboss.resteasy.spring</groupId>
        <artifactId>resteasy-integration-tests-spring</artifactId>
        <version>3.0.0.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>resteasy-integration-tests-spring-inmodule</artifactId>
    <name>RESTEasy Main testsuite: Spring integration tests - In module</name>

    <properties>
        <module.spring.version>3.2.x</module.spring.version>
        <module.spring.slot>main
        </module.spring.slot><!-- beware jbossws spring integration preinstalled in default distribution expects main slot -->
        <module.spring.path>
            ${jboss.home}/modules/system/add-ons/spring/org/springframework/spring/${module.spring.slot}
        </module.spring.path>
    </properties>

    <profiles>
        <!--
        Name:  download
        Descr: Download WildFly
        -->
        <profile>
            <id>download</id>
            <activation>
                <property>
                    <name>!server.home</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jboss.galleon</groupId>
                        <artifactId>galleon-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>server-provisioning</id>
                                <goals>
                                    <goal>provision</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemProperties>
                                <property>
                                    <name>java.util.logging.config.file</name>
                                    <value>src/test/resources/logging.properties</value>
                                </property>
                            </systemProperties>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>add-resteasy-spring</id>
            <activation>
                <property>
                    <name>include.resteasy.spring</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jboss.galleon</groupId>
                        <artifactId>galleon-maven-plugin</artifactId>
                        <configuration>
                            <!-- First configure the feature pack we are overriding -->
                            <feature-packs>
                                <feature-pack>
                                    <groupId>${feature.pack.groupId}</groupId>
                                    <artifactId>${feature.pack.artifactId}</artifactId>
                                    <version>${feature.pack.version}</version>
                                    <excluded-packages>
                                        <name>product.conf</name>
                                        <name>docs.schema</name>
                                    </excluded-packages>
                                </feature-pack>
                                <!-- Next include our own feature pack -->
                                <feature-pack>
                                    <groupId>org.jboss.resteasy.spring</groupId>
                                    <artifactId>galleon-feature-pack</artifactId>
                                    <version>${project.version}</version>
                                </feature-pack>
                            </feature-packs>
                        </configuration>
                        <executions>
                            <execution>
                                <id>server-provisioning-overridden</id>
                                <goals>
                                    <goal>provision</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>arquillian.xml</include>
                </includes>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
                <excludes>
                    <exclude>arquillian.xml</exclude>
                </excludes>
            </testResource>
        </testResources>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-core</artifactId>
            <version>${version.resteasy.testsuite}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.shrinkwrap.resolver</groupId>
            <artifactId>shrinkwrap-resolver-depchain</artifactId>
            <scope>test</scope>
            <type>pom</type>
            <exclusions>
                <exclusion>
                    <groupId>javax.inject</groupId>
                    <artifactId>javax.inject</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.enterprise</groupId>
                    <artifactId>cdi-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
