<?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>flow-plugins</artifactId>
    <version>9.0.0</version>
  </parent>
  <groupId>com.vaadin</groupId>
  <artifactId>flow-gradle-plugin</artifactId>
  <version>9.0.0</version>
  <name>Flow Gradle Plugin</name>
  <description>This maven module act as a proxy to test, build, and release the flow gradle plugin,
        which is written in Kotlin and is built by gradle natively. This makes development
        and testing of the gradle plugin much easier against the changes of flow, especially
        the flow-plugin-base. However, publishing the vaadin-gradle-plugin to gradle plugin
        central repo is done within platform final releases.</description>
  <url>https://vaadin.com/flow-plugins/flow-gradle-plugin</url>
  <licenses>
    <license>
      <name>Apache License Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <properties>
    <gradle.executable>./gradlew</gradle.executable>
  </properties>
  <dependencies>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>flow-plugin-base</artifactId>
      <version>9.0.0</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
              <useBaseVersion>true</useBaseVersion>
              <addParentPoms>true</addParentPoms>
              <copyPom>true</copyPom>
              <useRepositoryLayout>true</useRepositoryLayout>
              <outputDirectory>${project.build.directory}/dependencies</outputDirectory>
            </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>
