<?xml version="1.0" encoding="UTF-8"?>
<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.jboss</groupId>
    <artifactId>jboss-parent</artifactId>
    <version>41</version>
  </parent>

  <groupId>io.hawt</groupId>
  <artifactId>project</artifactId>
  <packaging>pom</packaging>
  <version>3.0.2</version>
  <name>hawtio-java-project</name>
  <description>Hawtio :: project</description>
  <url>https://hawt.io/</url>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:hawtio/hawtio.git</connection>
    <developerConnection>scm:git:git@github.com:hawtio/hawtio.git</developerConnection>
    <url>git@github.com:hawtio/hawtio.git</url>
    <tag>hawtio-3.0.2</tag>
  </scm>

  <distributionManagement>
    <repository>
      <id>oss-sonatype-staging</id>
      <name>Sonatype Staging Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
    </repository>
    <snapshotRepository>
      <id>oss-sonatype-snapshots</id>
      <name>OSS Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <failIfNoTests>false</failIfNoTests>
    <jettyPort>8282</jettyPort>
    <context>/hawtio</context>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>

    <webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
    <webapp-outdir>${basedir}/target/${webapp-dir}</webapp-outdir>

    <blueprint-web-version>1.1.0</blueprint-web-version>
    <build-helper-maven-plugin-version>3.6.0</build-helper-maven-plugin-version>

    <!-- Spring versions -->
    <spring-version>5.3.36</spring-version>
    <spring-boot-version>2.7.18</spring-boot-version>

    <!-- Quarkus version -->
    <quarkus-version>2.16.12.Final</quarkus-version>

    <assertj-core-version>3.26.0</assertj-core-version>
    <commons-codec-version>1.16.1</commons-codec-version>
    <commons-io-version>2.16.1</commons-io-version>
    <commons-logging-version>1.3.2</commons-logging-version>
    <exec-maven-plugin-version>3.3.0</exec-maven-plugin-version>
    <frontend-maven-plugin-version>1.15.0</frontend-maven-plugin-version>
    <guava-version>33.2.0-jre</guava-version>
    <hamcrest-version>2.2</hamcrest-version>
    <httpclient-version>4.5.14</httpclient-version>
    <jackson-version>2.17.1</jackson-version>
    <jackson-version-range>[2.8,3)</jackson-version-range>
    <jetty-version>10.0.21</jetty-version>
    <jetty-plugin-version>${jetty-version}</jetty-plugin-version>
    <jolokia-version>1.7.2</jolokia-version>
    <junit5-version>5.10.2</junit5-version>
    <karaf-version>4.4.6</karaf-version>
    <karaf-version-range>[4.0,5)</karaf-version-range>
    <keycloak-version>24.0.4</keycloak-version>
    <log4j2-version>2.23.1</log4j2-version>
    <maven-antrun-plugin-version>3.1.0</maven-antrun-plugin-version>
    <maven-clean-plugin-version>3.3.2</maven-clean-plugin-version>
    <maven-compiler-plugin-version>3.13.0</maven-compiler-plugin-version>
    <maven-dependency-plugin-version>3.6.1</maven-dependency-plugin-version>
    <maven-failsafe-plugin-version>3.2.5</maven-failsafe-plugin-version>
    <maven-release-plugin-version>3.0.1</maven-release-plugin-version>
    <maven-resources-plugin-version>2.6</maven-resources-plugin-version>
    <maven-surefire-plugin-version>3.2.5</maven-surefire-plugin-version>
    <mockito-core-version>5.12.0</mockito-core-version>
    <org-json-version>20240303</org-json-version>
    <osgi-version>6.0.0</osgi-version>
    <servlet-api-version>4.0.1</servlet-api-version>
    <!-- Pin SLF4J version until https://issues.apache.org/jira/browse/CAMEL-20598 is resolved at SLF4J -->
    <slf4j-version>2.0.11</slf4j-version>
    <wildfly-version>11.0.0.Final</wildfly-version>
    <wildfly-maven-plugin-version>1.2.1.Final</wildfly-maven-plugin-version>
    <jaxb-version>2.3.2</jaxb-version>
    <activation-version>1.2.0</activation-version>
    <spring-hateoas-version>0.25.0.RELEASE</spring-hateoas-version>
    <spring-plugin-core-version>1.2.0.RELEASE</spring-plugin-core-version>
    <docker-plugin-version>0.44.0</docker-plugin-version>

    <!-- Used for maven-frontend-plugin -->
    <node-version>v20.9.0</node-version>
    <yarn-version>v1.22.21</yarn-version>
  </properties>

  <modules>
    <module>bom</module>
    <module>console</module>
    <module>deploy/hawtio-default</module>
    <module>deploy/hawtio-embedded</module>
    <module>examples/quarkus</module>
    <module>examples/quarkus-keycloak</module>
    <module>examples/sample-plugin</module>
    <module>examples/springboot</module>
    <module>examples/springboot-authentication</module>
    <module>examples/springboot-keycloak</module>
    <module>examples/springboot-log4j2</module>
    <module>examples/springboot-plugin</module>
    <module>examples/springboot-security</module>
    <module>examples/war-plugin</module>
    <module>hawtio-jbang</module>
    <module>hawtio-plugin-mbean</module>
    <module>hawtio-system</module>
    <module>hawtio-war</module>
    <module>platforms/quarkus</module>
    <module>platforms/springboot</module>
    <module>platforms/springboot-keycloak</module>
    <module>plugins/hawtio-local-jvm-mbean</module>
    <module>plugins/hawtio-log-logback</module>
    <module>plugins/hawtio-log</module>
  </modules>

  <build>
    <defaultGoal>install</defaultGoal>

    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-integration-test-sources</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/integration-test/java</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-integration-test-resources</id>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>add-test-resource</goal>
            </goals>
            <configuration>
              <resources>
                <resource>
                  <filtering>true</filtering>
                  <directory>src/integration-test/resources</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <!--
          <tag>hawtio-${project.version}</tag>
          -->
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
          <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
          <childDelegation>false</childDelegation>
          <useFile>true</useFile>
          <failIfNoTests>false</failIfNoTests>
          <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
          <runOrder>alphabetical</runOrder>
          <systemPropertyVariables>
            <basedir>${basedir}</basedir>
            <java.awt.headless>true</java.awt.headless>
          </systemPropertyVariables>

          <excludes>
            <exclude>**/*IT.*</exclude>
            <exclude>**/*ITCase.*</exclude>
          </excludes>

          <includes>
            <include>**/*Test.*</include>
          </includes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <id>integration-tests</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>**/*Test.*</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven-clean-plugin-version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin-version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${maven-dependency-plugin-version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven-failsafe-plugin-version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin-version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin-version}</version>
        </plugin>
        <plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>${frontend-maven-plugin-version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${build-helper-maven-plugin-version}</version>
        </plugin>
        <plugin>
          <groupId>io.fabric8</groupId>
          <artifactId>docker-maven-plugin</artifactId>
          <version>${docker-plugin-version}</version>
        </plugin>
      </plugins>
    </pluginManagement>

  </build>

  <profiles>
    <profile>
      <id>fastinstall</id>
      <properties>
        <skipTests>true</skipTests>
        <skip.yarn>true</skip.yarn>
      </properties>
    </profile>

    <profile>
      <id>e2e</id>
      <modules>
        <module>tests</module>
      </modules>
    </profile>

    <profile>
      <id>release</id>
      <!--
      TODO when using the release profile you should add your ~/.m2/settings.xml something like this:

      <settings>
        <profiles>
          <profile>
            <id>release</id>
            <properties>
              <gpg.passphrase>MyPassPhrase</gpg.passphrase>
            </properties>
          </profile>
          ...
      -->

      <!--
        Run the release /w the -P release flag to enable the release profile.
      -->
      <build>
        <plugins>
          <!-- We want to sign the artifact, the POM, and all attached artifacts -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <configuration>
              <!--suppress UnresolvedMavenProperty -->
              <passphrase>${gpg.passphrase}</passphrase>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <encoding>${project.build.sourceEncoding}</encoding>
              <doclint>none</doclint>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
