<?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>4.8.0</version>
    </parent>

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

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

    <properties>
        <jboss.server.name>wildfly-${version.wildfly}</jboss.server.name>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.wildfly.extras.patch</groupId>
            <artifactId>fuse-patch-config</artifactId>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.wildfly.build</groupId>
                <artifactId>wildfly-server-provisioning-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>wildfly</id>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <phase>process-test-classes</phase>
                        <configuration>
                            <config-file>scripts/server-provisioning.xml</config-file>
                            <server-name>${jboss.server.name}</server-name>
                        </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>
                        <copy file="${project.build.directory}/${jboss.server.name}/standalone/configuration/standalone.xml" todir="${project.build.testOutputDirectory}" overwrite="true" />
                    </tasks>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
