<?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.alipay.sofa</groupId>
    <artifactId>sofa-boot-tools</artifactId>
    <version>3.16.0</version>
  </parent>
  <groupId>com.alipay.sofa</groupId>
  <artifactId>sofa-boot-gradle-plugin</artifactId>
  <version>3.16.0</version>
  <packaging>pom</packaging>
  <name>SOFA Boot Gradle Plugin</name>
  <description>SOFA Boot Gradle Plugin</description>
  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <properties>
    <gradle.task>build</gradle.task>
    <skip.gradle.build>false</skip.gradle.build>
    <gradle.executable>./gradlew</gradle.executable>
    <main.user.dir>${basedir}/../../..</main.user.dir>
    <skip.gradle.test>false</skip.gradle.test>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-gradle-plugin</artifactId>
      <version>2.4.13</version>
    </dependency>
    <dependency>
      <groupId>io.spring.gradle</groupId>
      <artifactId>dependency-management-plugin</artifactId>
      <version>1.0.11.RELEASE</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-compress</artifactId>
      <version>1.19</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-compile-dependencies</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
              <includeScope>compile</includeScope>
              <outputDirectory>${project.build.directory}/dependencies/compile</outputDirectory>
            </configuration>
          </execution>
          <execution>
            <id>copy-test-dependencies</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
              <includeScope>test</includeScope>
              <outputDirectory>${project.build.directory}/dependencies/test</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>gradle_test</id>
            <phase>test</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>${gradle.executable}</executable>
              <arguments>
                <argument>clean</argument>
                <argument>test</argument>
                <argument>-Pversion=${project.version}</argument>
                <argument>-Pdescription=${project.description}</argument>
                <argument>-S</argument>
              </arguments>
              <skip>${skip.gradle.test}</skip>
            </configuration>
          </execution>
          <execution>
            <id>gradle_build</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>${gradle.executable}</executable>
              <arguments>
                <argument>clean</argument>
                <argument>${gradle.task}</argument>
                <argument>-Pversion=${project.version}</argument>
                <argument>-Pdescription=${project.description}</argument>
                <argument>-S</argument>
                <argument>-x</argument>
                <argument>test</argument>
              </arguments>
              <skip>${skip.gradle.build}</skip>
            </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>build/libs/${project.artifactId}-${project.version}.jar</file>
                  <type>jar</type>
                </artifact>
                <artifact>
                  <file>build/libs/${project.artifactId}-${project.version}-sources.jar</file>
                  <type>jar</type>
                  <classifier>sources</classifier>
                </artifact>
              </artifacts>
              <skipAttach>${skip.gradle.build}</skipAttach>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>windows</id>
      <activation>
        <os>
          <family>windows</family>
        </os>
      </activation>
      <properties>
        <gradle.executable>gradlew.bat</gradle.executable>
      </properties>
    </profile>
    <profile>
      <id>skipTests</id>
      <activation>
        <property>
          <name>skipTests</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <gradle.task>assemble</gradle.task>
        <skip.gradle.test>true</skip.gradle.test>
      </properties>
    </profile>
  </profiles>
</project>
