<?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>io.hawt</groupId>
    <artifactId>hawtio-quarkus-parent</artifactId>
    <version>4.3.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>hawtio-quarkus</artifactId>
  <name>${project.artifactId}</name>
  <description>Hawtio :: Quarkus Extension</description>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-bom</artifactId>
        <version>${quarkus-version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-undertow</artifactId>
    </dependency>
    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-system</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-war</artifactId>
      <version>${project.version}</version>
      <type>war</type>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>repackage</id>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <phase>prepare-package</phase>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/META-INF/resources/hawtio</outputDirectory>
              <includeArtifactIds>hawtio-war</includeArtifactIds>
              <excludeTypes>pom</excludeTypes>
              <excludes>**/WEB-INF/classes/**,**/WEB-INF/lib/**,**/META-INF/**</excludes>
              <excludeTransitive>true</excludeTransitive>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>${maven-antrun-plugin-version}</version>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <move file="${project.build.outputDirectory}/META-INF/resources/hawtio/WEB-INF/web.xml" todir="${project.build.directory}/classes/META-INF/" />
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-extension-maven-plugin</artifactId>
        <version>${quarkus-version}</version>
        <executions>
          <execution>
            <goals>
              <goal>extension-descriptor</goal>
            </goals>
            <configuration>
              <deployment>${project.groupId}:${project.artifactId}-deployment:${project.version}</deployment>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <annotationProcessorPaths>
            <path>
              <groupId>io.quarkus</groupId>
              <artifactId>quarkus-extension-processor</artifactId>
              <version>${quarkus-version}</version>
            </path>
          </annotationProcessorPaths>
          <compilerArgs>
            <arg>-AlegacyConfigRoot=true</arg>
          </compilerArgs>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
