<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2010, Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->

<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.tools</groupId>
        <artifactId>wildfly-parent</artifactId>
        <version>1.0.2.Final</version>
    </parent>
    <groupId>org.wildfly.plugins</groupId>
    <artifactId>wildfly-maven-plugin-parent</artifactId>
    <version>4.1.1.Final</version>
    <packaging>pom</packaging>
    <name>WildFly Maven Plugin - Parent</name>

    <description>A maven plugin that allows various management operations to be executed on WildFly Application
        Server.
    </description>
    <url>https://www.wildfly.org</url>

    <issueManagement>
        <system>JIRA</system>
        <url>https://issues.redhat.com/browse/WFMP</url>
    </issueManagement>

    <!-- required when provisioning the server for tests, using Galleon plugin to be removed when WF doesn't require them -->
    <repositories>
        <repository>
            <id>nexus</id>
            <url>https://repository.jboss.org/nexus/content/groups/public</url>
        </repository>
        <repository>
            <id>redhat-ga</id>
            <url>https://maven.repository.redhat.com/ga/</url>
        </repository>
    </repositories>

    <mailingLists>
        <mailingList>
            <name>JBoss User List</name>
            <subscribe>https://lists.jboss.org/mailman/listinfo/jboss-user</subscribe>
            <unsubscribe>https://lists.jboss.org/mailman/listinfo/jboss-user</unsubscribe>
            <archive>http://lists.jboss.org/pipermail/jboss-user/</archive>
        </mailingList>
        <mailingList>
            <name>WildFly Developer List</name>
            <subscribe>https://lists.jboss.org/mailman/listinfo/wildfly-dev</subscribe>
            <unsubscribe>https://lists.jboss.org/mailman/listinfo/wildfly-dev</unsubscribe>
            <archive>http://lists.jboss.org/pipermail/wildfly-dev/</archive>
        </mailingList>
    </mailingLists>

    <scm>
        <connection>${wildfly.scm.connection}</connection>
        <developerConnection>${wildfly.scm.developer.connection}</developerConnection>
        <url>${wildfly.scm.url}</url>
    </scm>

    <licenses>
        <license>
            <name>GNU Lesser General Public License v2.1 only</name>
            <url>https://repository.jboss.org/licenses/lgpl-2.1.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>


    <properties>
        <!-- WildFly/JBoss dependencies -->
        <version.org.jboss.logging.jboss-logging>3.5.1.Final</version.org.jboss.logging.jboss-logging>
        <version.org.jboss.logmanager>2.1.19.Final</version.org.jboss.logmanager>
        <version.org.wildfly.checkstyle-config>1.0.8.Final</version.org.wildfly.checkstyle-config>
        <version.org.wildfly.common.wildfly-common>1.6.0.Final</version.org.wildfly.common.wildfly-common>
        <!-- This version property is also retrieved by plugin at runtime to resolve CLI artifact -->
        <version.org.wildfly.core>20.0.2.Final</version.org.wildfly.core>
        <version.org.wildfly>27.0.1.Final</version.org.wildfly>
        <version.org.wildfly.channel>1.0.2.Final</version.org.wildfly.channel>
        <version.org.wildfly.prospero>1.0.2.Final</version.org.wildfly.prospero>
        <!-- maven dependencies -->
        <version.javax.inject.javax.inject>1</version.javax.inject.javax.inject>
        <version.org.apache.maven.maven-core>3.6.2</version.org.apache.maven.maven-core>
        <version.org.apache.maven.plugin-testing.maven-plugin-testing-harness>3.3.0
        </version.org.apache.maven.plugin-testing.maven-plugin-testing-harness>
        <version.org.apache.maven.plugin-tools>3.7.0</version.org.apache.maven.plugin-tools>
        <version.org.apache.maven.shared>0.9.1</version.org.apache.maven.shared>
        <version.org.apache.maven.resolver>1.9.6</version.org.apache.maven.resolver>
        <!-- maven dependencies only required by tests -->
        <version.org.apache.maven.wagon>3.5.3</version.org.apache.maven.wagon>

        <version.org.eclipse.sisu>0.3.5</version.org.eclipse.sisu>
        <version.org.twdata.maven>2.3.1</version.org.twdata.maven>

        <!-- other dependencies -->
        <version.com.bernardomg.maven.skins>2.3.2</version.com.bernardomg.maven.skins>
        <version.junit.junit>4.13.2</version.junit.junit>
        <version.org.mockito.mockito>5.4.0</version.org.mockito.mockito>

        <!-- Require at least Java 11 to compile -->
        <jdk.min.version>11</jdk.min.version>
        <maven.compiler.target>11</maven.compiler.target>
        <maven.compiler.source>11</maven.compiler.source>

        <!-- galleon properties -->
        <version.org.jboss.galleon>5.1.0.Final</version.org.jboss.galleon>
        <plugin.fork.embedded>true</plugin.fork.embedded>
        <!-- used by tests -->
        <version.org.jboss.logging.slf4j-jboss-logging>1.2.1.Final</version.org.jboss.logging.slf4j-jboss-logging>

        <!-- checkstyle configuration -->
        <linkXRef>false</linkXRef>

        <!-- documentation properties -->
        <appServerName>WildFly</appServerName>
        <pluginPrefix>wildfly</pluginPrefix>

        <wildfly.scm.connection>scm:git://github.com/wildfly/wildfly-maven-plugin.git</wildfly.scm.connection>
        <wildfly.scm.developer.connection>scm:git:git@github.com:wildfly/wildfly-maven-plugin.git
        </wildfly.scm.developer.connection>
        <wildfly.scm.url>https://github.com/wildfly/wildfly-maven-plugin</wildfly.scm.url>

        <!-- Other properties -->
        <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
    </properties>

    <modules>
        <module>core</module>
        <module>plugin</module>
        <module>tests</module>
    </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <additionalJOption>--no-module-directories</additionalJOption>
                        <doclint>none</doclint>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.sisu</groupId>
                    <artifactId>sisu-maven-plugin</artifactId>
                    <version>${version.org.eclipse.sisu}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${version.org.apache.maven.maven-core}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <redirectTestOutputToFile>${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jboss.galleon</groupId>
                    <artifactId>galleon-maven-plugin</artifactId>
                    <version>${version.org.jboss.galleon}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <release>${maven.compiler.target}</release>
                    <testRelease>${maven.compiler.testTarget}</testRelease>
                </configuration>
            </plugin>
            <!-- Enable auto-formatting of source files -->
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <configuration>
                    <configLocation>wildfly-checkstyle/checkstyle.xml</configLocation>
                    <consoleOutput>true</consoleOutput>
                    <excludes>**/HelpMojo.java</excludes>
                    <failsOnError>true</failsOnError>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <useFile/>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.wildfly.checkstyle</groupId>
                        <artifactId>wildfly-checkstyle-config</artifactId>
                        <version>${version.org.wildfly.checkstyle-config}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>check-style</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>checkstyle</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <!-- Docs Maven Skin -->
                        <groupId>com.bernardomg.maven.skins</groupId>
                        <artifactId>docs-maven-skin</artifactId>
                        <version>${version.com.bernardomg.maven.skins}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>javax.inject</groupId>
                <artifactId>javax.inject</artifactId>
                <version>${version.javax.inject.javax.inject}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-core</artifactId>
                <version>${version.org.apache.maven.maven-core}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-plugin-api</artifactId>
                <version>${version.org.apache.maven.maven-core}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.shared</groupId>
                <artifactId>maven-artifact-transfer</artifactId>
                <version>${version.org.apache.maven.shared}</version>
                <exclusions>
                    <exclusion>
                        <groupId>*</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!-- dependencies to annotations -->
            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-annotations</artifactId>
                <version>${version.org.apache.maven.plugin-tools}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.resolver</groupId>
                <artifactId>maven-resolver-api</artifactId>
                <version>${version.org.apache.maven.resolver}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.resolver</groupId>
                <artifactId>maven-resolver-spi</artifactId>
                <version>${version.org.apache.maven.resolver}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.resolver</groupId>
                <artifactId>maven-resolver-impl</artifactId>
                <version>${version.org.apache.maven.resolver}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.resolver</groupId>
                <artifactId>maven-resolver-connector-basic</artifactId>
                <version>${version.org.apache.maven.resolver}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-http</artifactId>
                <version>${version.org.apache.maven.wagon}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.resolver</groupId>
                <artifactId>maven-resolver-transport-wagon</artifactId>
                <version>${version.org.apache.maven.resolver}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.resolver</groupId>
                <artifactId>maven-resolver-util</artifactId>
                <version>${version.org.apache.maven.resolver}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.galleon</groupId>
                <artifactId>galleon-maven-plugin</artifactId>
                <version>${version.org.jboss.galleon}</version>
                <exclusions>
                    <exclusion>
                        <groupId>*</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.jboss.galleon</groupId>
                <artifactId>galleon-core</artifactId>
                <version>${version.org.jboss.galleon}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.galleon</groupId>
                <artifactId>galleon-maven-universe</artifactId>
                <version>${version.org.jboss.galleon}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.maven.shared</groupId>
                        <artifactId>maven-artifact-transfer</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.maven</groupId>
                        <artifactId>maven-artifact</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.eclipse.aether</groupId>
                        <artifactId>aether-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.eclipse.aether</groupId>
                        <artifactId>aether-util</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging</artifactId>
                <version>${version.org.jboss.logging.jboss-logging}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.common</groupId>
                <artifactId>wildfly-common</artifactId>
                <version>${version.org.wildfly.common.wildfly-common}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.core</groupId>
                <artifactId>wildfly-cli</artifactId>
                <version>${version.org.wildfly.core}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.jboss.logging</groupId>
                        <artifactId>jboss-logging-processor</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.jboss.logmanager</groupId>
                        <artifactId>jboss-logmanager</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-plugin-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.channel</groupId>
                <artifactId>channel-core</artifactId>
                <version>${version.org.wildfly.channel}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.channel</groupId>
                <artifactId>maven-resolver</artifactId>
                <version>${version.org.wildfly.channel}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.checkstyle</groupId>
                <artifactId>wildfly-checkstyle-config</artifactId>
                <version>${version.org.wildfly.checkstyle-config}</version>
                <!-- only needed during compile -->
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.wildfly.core</groupId>
                <artifactId>wildfly-controller-client</artifactId>
                <version>${version.org.wildfly.core}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.core</groupId>
                <artifactId>wildfly-launcher</artifactId>
                <version>${version.org.wildfly.core}</version>
            </dependency>
            <!-- Seems to be needed as the controller client is transitively bringing it in -->
            <dependency>
                <groupId>org.wildfly.core</groupId>
                <artifactId>wildfly-protocol</artifactId>
                <version>${version.org.wildfly.core}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.prospero</groupId>
                <artifactId>prospero-metadata</artifactId>
                <version>${version.org.wildfly.prospero}</version>
                <exclusions>
                    <exclusion>
                        <groupId>*</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- Test dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${version.junit.junit}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-compat</artifactId>
                <version>${version.org.apache.maven.maven-core}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-settings-builder</artifactId>
                <version>${version.org.apache.maven.maven-core}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugin-testing</groupId>
                <artifactId>maven-plugin-testing-harness</artifactId>
                <version>${version.org.apache.maven.plugin-testing.maven-plugin-testing-harness}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.logmanager</groupId>
                <artifactId>jboss-logmanager</artifactId>
                <version>${version.org.jboss.logmanager}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${version.org.mockito.mockito}</version>
            </dependency>
           <dependency>
                <groupId>org.jboss.slf4j</groupId>
                <artifactId>slf4j-jboss-logging</artifactId>
                <version>${version.org.jboss.logging.slf4j-jboss-logging}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>generate-javadoc</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>javadoc</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>format-check</id>
            <build>
                <plugins>
                    <!-- Validate formatting -->
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>validate-format</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>check-import-sort</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
