<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2015 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">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.switchyard</groupId>
        <artifactId>switchyard-core-parent</artifactId>
        <version>2.1.0-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    <artifactId>switchyard-security-wildfly</artifactId>
    <packaging>bundle</packaging>
    <name>SwitchYard: Security - WildFly</name>
    <description>The WildFly security library.</description>
    <url>http://switchyard.org</url>
    <properties>
        <switchyard.osgi.export.pkg>
            org.switchyard.security.jboss.*
        </switchyard.osgi.export.pkg>
        <common.sources.dir>${project.build.directory}/dependency/jboss/java</common.sources.dir>
        <common.resources.dir>${project.build.directory}/dependency/jboss/resources</common.resources.dir>
        <common.test.resources.dir>${project.build.directory}/dependency/jboss-test/resources</common.test.resources.dir>
        <version.wildfly>10.0.0.Final</version.wildfly>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.wildfly</groupId>
                <artifactId>wildfly-parent</artifactId>
                <type>pom</type>
                <scope>import</scope>
                <version>${version.wildfly}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <!-- internal dependencies -->
        <dependency>
            <groupId>org.switchyard</groupId>
            <artifactId>switchyard-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.switchyard</groupId>
            <artifactId>switchyard-common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.switchyard</groupId>
            <artifactId>switchyard-security</artifactId>
        </dependency>
        <!-- external dependencies -->
        <dependency>
            <groupId>org.jboss.com.sun.httpserver</groupId>
            <artifactId>httpserver</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging-annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.picketbox</groupId>
            <artifactId>picketbox</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.picketlink</groupId>
            <artifactId>picketlink-federation</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.picketlink.distribution</groupId>
            <artifactId>picketlink-wildfly8</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.wildfly</groupId>
            <artifactId>wildfly-picketlink</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>stage-common-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <copy todir="${common.sources.dir}">
                                    <fileset dir="../jboss/src/main/java/" includes="**/*.java">
                                        <exclude name="org/switchyard/security/jboss/credential/extractor/JBossServletRequestCredentialExtractor.java"/>
                                    </fileset>
                                </copy>
                                <copy todir="${common.resources.dir}">
                                    <fileset dir="../jboss/src/main/resources/">
                                        <exclude name="META-INF/services/org.switchyard.security.credential.extractor.ServletRequestCredentialExtractor"/>
                                    </fileset>
                                </copy>
                                 <copy todir="${common.test.resources.dir}">
                                    <fileset dir="../jboss/src/test/resources/"/>
                                </copy>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-common-sources-dir</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${common.sources.dir}</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-common-resources-dir</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${common.resources.dir}</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-common-test-resources-dir</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${common.test.resources.dir}</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                 </executions>
            </plugin>
        </plugins>
    </build>
</project>
