<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2020 Red Hat, Inc. and/or its affiliates
    and other contributors as indicated by the @author tags.

    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.plugins</groupId>
        <artifactId>wildfly-jar-parent</artifactId>
        <version>12.0.0.Final</version>
    </parent>

    <artifactId>wildfly-jar-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>

    <name>WildFly Bootable JAR Maven Plugin</name>

    <properties>
        <!-- Galleon -->
        <galleon.fork.embedded>true</galleon.fork.embedded>
        <galleon.log.time>true</galleon.log.time>
        <galleon.offline>false</galleon.offline>
        <jboss.home>${project.build.directory}${file.separator}wildfly</jboss.home>
        <!-- Used in the test module.xml -->
        <test.class.path>${project.build.testOutputDirectory}</test.class.path>
        <test.jvm.args>-Dmaven.repo.local=${settings.localRepository}</test.jvm.args>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.twdata.maven</groupId>
            <artifactId>mojo-executor</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>wildfly-jar-cloud-extension</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.galleon</groupId>
            <artifactId>galleon-maven-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.galleon</groupId>
            <artifactId>galleon-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-artifact-transfer</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
            <scope>provided</scope>
        </dependency>
         <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.wildfly.launcher</groupId>
            <artifactId>wildfly-launcher</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-plugin-tools</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.channel</groupId>
            <artifactId>channel-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.channel</groupId>
            <artifactId>maven-resolver</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wildfly.prospero</groupId>
            <artifactId>prospero-metadata</artifactId>
        </dependency>
        <dependency>
          <groupId>org.wildfly.core</groupId>
          <artifactId>wildfly-protocol</artifactId>
      </dependency>
      <dependency>
          <groupId>org.wildfly.core</groupId>
          <artifactId>wildfly-controller-client</artifactId>
      </dependency>
        <!-- Required by Galleon during provisioning --> 
        <dependency>
            <groupId>org.wildfly.common</groupId>
            <artifactId>wildfly-common</artifactId>
        </dependency>
        <!-- Test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${version.enforcer.plugin}</version>
                <executions>
                    <execution>
                        <id>ban-bad-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <searchTransitive>true</searchTransitive>
                                    <excludes>
                                        <!-- we don't want these in the plugin classpath -->
                                        <exclude>org.jboss.modules:jboss-modules</exclude>
                                        <exclude>org.wildfly.core:wildfly-cli</exclude>
                                        <exclude>org.wildfly.core:wildfly-embedded</exclude>
                                        <exclude>org.wildfly.core:wildfly-patching</exclude>
                                        <exclude>org.jboss.logmanager:jboss-logmanager</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <configuration>
                    <!-- see http://jira.codehaus.org/browse/MNG-5346 -->
                    <!--<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>-->
                    <goalPrefix>wildfly-jar</goalPrefix>
                </configuration>

                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>help-goal</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                        <configuration>
                            <helpPackageName>org.wildfly.plugin.bootablejar.maven.generated</helpPackageName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <jboss.home>${jboss.home}</jboss.home>
                        <test.jvm.args>${test.jvm.args}</test.jvm.args>
                    </systemPropertyVariables>
                    <argLine>${client.jvm.jpms.args}</argLine>
                    <redirectTestOutputToFile>${surefire.redirect.to.file}</redirectTestOutputToFile>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.wildfly.extras</groupId>
                <artifactId>adoc-maven-plugin-descriptor</artifactId>
                <version>${version.adoc-maven-plugin-descriptor}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>asciidoc-descriptor</goal>
                        </goals>
                        <phase>prepare-package</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
