<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://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-platform-parent</artifactId>
    <version>24.2.2</version>
  </parent>
  <groupId>com.vaadin</groupId>
  <artifactId>vaadin-gradle-plugin</artifactId>
  <version>24.2.2</version>
  <name>Vaadin Gradle plugin</name>
  <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>
    <maven.compiler.target>17</maven.compiler.target>
    <gradle.publish.key>${gradlePublishKey}</gradle.publish.key>
    <gradle.publish.secret>${gradlePublishSecret}</gradle.publish.secret>
    <maven.compiler.source>17</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <gradle.executable>./gradlew</gradle.executable>
    <flow.version>24.2.2</flow.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-plugin-base</artifactId>
      <version>24.2.2</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-gradle-plugin</artifactId>
      <version>24.2.2</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-prod-bundle</artifactId>
      <version>24.2.2</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-dev-bundle</artifactId>
      <version>24.2.2</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>${project.basedir}/src/main</directory>
              <includes>
                <include>**</include>
              </includes>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.vaadin</groupId>
                  <artifactId>flow-gradle-plugin</artifactId>
                  <version>${flow.version}</version>
                  <classifier>sources</classifier>
                  <includes>**/*.kt</includes>
                  <outputDirectory>src/main/kotlin</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>com.vaadin</groupId>
                  <artifactId>flow-gradle-plugin</artifactId>
                  <version>${flow.version}</version>
                  <excludes>**/*.class,META-INF/**</excludes>
                  <outputDirectory>src/main/resources</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>com.vaadin</groupId>
                  <artifactId>flow-gradle-plugin</artifactId>
                  <version>${flow.version}</version>
                  <includes>**/lifecycle-mapping-metadata.xml</includes>
                  <outputDirectory>src/main/resources</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>gradle</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>${gradle.executable}</executable>
              <arguments>
                <argument>clean</argument>
                <argument>build</argument>
                <argument>javadocJar</argument>
                <argument>-x</argument>
                <argument>functionalTest</argument>
                <argument>-S</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>copy-gradle-jars</id>
            <phase>package</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target</outputDirectory>
              <resources>
                <resource>
                  <directory>build/libs/</directory>
                  <includes>
                    <include>**/*.jar</include>
                  </includes>
                </resource>
              </resources>
              <overwrite>true</overwrite>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>target/${project.artifactId}-${project.version}-sources.jar</file>
                  <type>jar</type>
                  <classifier>sources</classifier>
                </artifact>
                <artifact>
                  <file>target/${project.artifactId}-${project.version}-javadoc.jar</file>
                  <type>jar</type>
                  <classifier>javadoc</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
