<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2014 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.wildfly.camel</groupId>
        <artifactId>wildfly-camel</artifactId>
        <version>10.2.0</version>
    </parent>

    <name>Wildfly Camel :: Config</name>
    <artifactId>wildfly-camel-config</artifactId>

    <description>Wildfly Camel Default Configuration Utility</description>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.wildfly.camel</groupId>
                <artifactId>wildfly-camel-bom</artifactId>
                <version>${project.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <dependency>
            <groupId>args4j</groupId>
            <artifactId>args4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jdom</groupId>
            <artifactId>jdom</artifactId>
        </dependency>

        <!-- Provided -->
        <dependency>
            <groupId>org.jboss.modules</groupId>
            <artifactId>jboss-modules</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-parent</artifactId>
            <version>${version.apache.camel}</version>
            <scope>test</scope>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.wildfly</groupId>
            <artifactId>wildfly-parent</artifactId>
            <version>${version.wildfly}</version>
            <scope>test</scope>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.wildfly.camel</groupId>
            <artifactId>wildfly-camel</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jboss.galleon</groupId>
                <artifactId>galleon-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>server-provisioning</id>
                        <goals>
                            <goal>provision</goal>
                        </goals>
                        <phase>process-test-classes</phase>
                        <configuration>
                            <install-dir>${project.build.directory}/${jboss.server.name}</install-dir>
                            <offline>false</offline>
                            <feature-packs>
                                <feature-pack>
                                    <groupId>org.wildfly</groupId>
                                    <artifactId>wildfly-galleon-pack</artifactId>
                                    <version>${version.wildfly}</version>
                                    <inherit-configs>true</inherit-configs>
                                </feature-pack>
                            </feature-packs>
                            <plugin-options>
                                <jboss-maven-dist />
                                <jboss-fork-embedded />
                            </plugin-options>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-wildfly-configuration</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <tasks>
                        <echo>${basedir}/../pom.xml</echo>
                        <echo>${maven.dependency.org.apache.camel.camel-parent.pom.path}</echo>
                        <echo>${maven.dependency.org.wildfly.wildfly-parent.pom.path}</echo>
                        <propertyfile file="target/pom-paths.txt">
                            <entry key="wildfly-camel" value="${basedir}/../pom.xml" />
                            <entry key="camel-parent" value="${maven.dependency.org.apache.camel.camel-parent.pom.path}" />
                            <entry key="wildfly-parent" value="${maven.dependency.org.wildfly.wildfly-parent.pom.path}" />
                        </propertyfile>
                        <copy file="${project.build.directory}/${jboss.server.name}/standalone/configuration/standalone.xml" todir="${project.build.testOutputDirectory}" overwrite="true" />
                    </tasks>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
