<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-quarkus-extension-parent</artifactId>
    <version>24.9.6</version>
  </parent>
  <groupId>com.vaadin</groupId>
  <artifactId>vaadin-quarkus-extension</artifactId>
  <version>24.9.6</version>
  <name>Vaadin Quarkus Extension</name>
  <description>Dependency for a Quarkus project.</description>
  <licenses>
    <license>
      <name>Apache License Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <properties>
    <vaadin.version>${project.version}</vaadin.version>
    <quarkus.version>3.20.1</quarkus.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-bom</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-quarkus</artifactId>
      <version>2.2.2</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>com.vaadin</groupId>
          <artifactId>flow-server</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-core</artifactId>
      <version>24.9.6</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>com.vaadin</groupId>
          <artifactId>hilla-dev</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-core-jandex</artifactId>
      <version>24.9.6</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.5.0</version>
        <executions>
          <execution>
            <id>unpack-extension-resources</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.vaadin</groupId>
                  <artifactId>vaadin-quarkus</artifactId>
                  <type>jar</type>
                  <outputDirectory>${project.build.directory}/build/quarkus-metadata</outputDirectory>
                  <includes>META-INF/quarkus-extension.yaml</includes>
                </artifactItem>
                <artifactItem>
                  <groupId>com.vaadin</groupId>
                  <artifactId>vaadin-quarkus</artifactId>
                  <classifier>codestarts</classifier>
                  <type>jar</type>
                  <outputDirectory>${project.build.directory}/build/quarkus-codestarts</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.5.1</version>
        <executions>
          <execution>
            <id>prepare-extension-metadata</id>
            <phase>process-resources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>${env.JAVA_HOME}/bin/java</executable>
              <workingDirectory>${project.basedir}/scripts</workingDirectory>
              <arguments>
                <argument>MetaDataReplacements.java</argument>
                <argument>${project.build.directory}/build/quarkus-metadata/META-INF/quarkus-extension.yaml</argument>
                <argument>${project.version}</argument>
                <argument>${vaadin.quarkus.version}</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>clone-extension-codestarts</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/processed-quarkus-codestarts</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/build/quarkus-codestarts</directory>
                  <excludes>
                    <exclude>**/codestart.yml</exclude>
                    <exclude>META-INF/**</exclude>
                  </excludes>
                  <filtering>false</filtering>
                </resource>
                <resource>
                  <directory>${project.build.directory}/build/quarkus-codestarts</directory>
                  <includes>
                    <include>**/codestart.yml</include>
                  </includes>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-extension-maven-plugin</artifactId>
        <version>${quarkus.version}</version>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>extension-descriptor</goal>
            </goals>
            <configuration>
              <extensionFile>${project.build.directory}/build/quarkus-metadata/META-INF/quarkus-extension.yaml</extensionFile>
              <deployment>${project.groupId}:${project.artifactId}-deployment:${project.version}</deployment>
              <skipExtensionValidation>true</skipExtensionValidation>
              <skipCodestartValidation>true</skipCodestartValidation>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>generate-codestart-jar</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classesDirectory>${project.build.directory}/processed-quarkus-codestarts</classesDirectory>
              <classifier>codestarts</classifier>
              <skipIfEmpty>true</skipIfEmpty>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
