<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source
  ~ Copyright 2016, Red Hat, Inc., and individual contributors as indicated
  ~ by the @authors tag.
  ~
  ~ 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.wildfly.legacy.test</groupId>
        <artifactId>wildfly-legacy-spi-parent</artifactId>
        <version>3.0.0.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>wildfly-legacy-spi-dependencies</artifactId>

    <name>WildFly: Legacy Test SPI Dependencies</name>
    <description>
        Current wildfly-core classes used by the SPI to avoid needing to bring in classes from WildFly (the consumer)
        to avoid circular dependencies
    </description>
    <packaging>pom</packaging>

    <properties>
        <wildfly.lib.directory>${project.build.sourceDirectory}/../../../lib</wildfly.lib.directory>
    </properties>

    <dependencies>
        <!--
          Jars built from current wildfly-core needed to get things to compile. We cannot add normal maven
          dependencies on these since they are in SNAPSHOT and also this would cause circular dependencies.
          WildFly core is a consumer of this project.
        -->
        <dependency>
            <groupId>org.wildfly.legacy.test.direct</groupId>
            <artifactId>wildfly-controller</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${wildfly.lib.directory}/wildfly-controller.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.wildfly.legacy.test.direct</groupId>
            <artifactId>wildfly-core-model-test-framework</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${wildfly.lib.directory}/wildfly-core-model-test-framework.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.wildfly.legacy.test.direct</groupId>
            <artifactId>wildfly-deployment-repository</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${wildfly.lib.directory}/wildfly-deployment-repository.jar</systemPath>
        </dependency>
        <!--
       <dependency>
          <groupId>org.wildfly.legacy.test.direct</groupId>
          <artifactId>wildfly-host-controller</artifactId>
          <version>1.0</version>
          <scope>system</scope>
          <systemPath>${wildfly.lib.directory}/wildfly-host-controller-${wildfly.current.version}.jar</systemPath>
       </dependency>
        -->
        <dependency>
            <groupId>org.wildfly.legacy.test.direct</groupId>
            <artifactId>wildfly-model-test</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${wildfly.lib.directory}/wildfly-model-test.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.wildfly.legacy.test.direct</groupId>
            <artifactId>wildfly-server</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${wildfly.lib.directory}/wildfly-server.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>org.wildfly.legacy.test.direct</groupId>
            <artifactId>wildfly-subsystem-test-framework</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${wildfly.lib.directory}/wildfly-subsystem-test-framework.jar</systemPath>
        </dependency>
       
        <!-- Other non wildfly-core dependencies needed to get things to compile -->
        <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jboss-dmr</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.msc</groupId>
            <artifactId>jboss-msc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jboss-vfs</artifactId>
        </dependency>
      
    </dependencies>


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${wildfly.lib.directory}</directory>
                            <followSymlinks>false</followSymlinks>
                            <useDefaultExcludes>true</useDefaultExcludes>
                            <includes>
                                <include>**</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.wildfly.core</groupId>
                                    <artifactId>wildfly-controller</artifactId>
                                    <version>${wildfly.current.version}</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.wildfly.core</groupId>
                                    <artifactId>wildfly-model-test</artifactId>
                                    <version>${wildfly.current.version}</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.wildfly.core</groupId>
                                    <artifactId>wildfly-core-model-test-framework</artifactId>
                                    <version>${wildfly.current.version}</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.wildfly.core</groupId>
                                    <artifactId>wildfly-deployment-repository</artifactId>
                                    <version>${wildfly.current.version}</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.wildfly.core</groupId>
                                    <artifactId>wildfly-server</artifactId>
                                    <version>${wildfly.current.version}</version>
                                    <type>jar</type>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.wildfly.core</groupId>
                                    <artifactId>wildfly-subsystem-test-framework</artifactId>
                                    <version>${wildfly.current.version}</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${wildfly.lib.directory}</outputDirectory>
                            <overWriteReleases>true</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                            <stripClassifier>true</stripClassifier>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
