<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~  Copyright 1999-2019 Seata.io Group.
  ~
  ~  Licensed under the Apache License, Version 2.0 (the "License");
  ~  you may not use this file except in compliance with the License.
  ~  You may obtain a copy of the License at
  ~
  ~       https://www.apache.org/licenses/LICENSE-2.0
  ~
  ~  Unless required by applicable law or agreed to in writing, software
  ~  distributed under the License is distributed on an "AS IS" BASIS,
  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~  See the License for the specific language governing permissions and
  ~  limitations under the License.
  -->
<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>
  <groupId>io.seata</groupId>
  <artifactId>seata-build</artifactId>
  <version>1.5.1</version>
  <packaging>pom</packaging>
  <name>Seata Build ${project.version}</name>
  <description>Seata Build Pom</description>
  <url>https://seata.io</url>
  <organization>
    <name>Seata</name>
    <url>https://github.com/seata</url>
  </organization>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>Seata</id>
      <name>Seata</name>
      <email>dev-seata@googlegroups.com</email>
      <url>https://seata.io</url>
    </developer>
  </developers>
  <scm>
    <connection>scm:git@github.com:seata/seata.git</connection>
    <developerConnection>scm:git@github.com:seata/seata.git</developerConnection>
    <url>git@github.com:seata/seata.git</url>
  </scm>
  <issueManagement>
    <system>github</system>
    <url>https://github.com/seata/seata/issues</url>
  </issueManagement>
  <properties>
    <os-maven-plugin.version>1.5.0.Final</os-maven-plugin.version>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <kotlin-maven-plugin.version>1.3.72</kotlin-maven-plugin.version>
    <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
    <maven.surefire.argLine></maven.surefire.argLine>
    <maven-pmd-plugin.version>3.8</maven-pmd-plugin.version>
    <image.tags>latest</image.tags>
    <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
    <mojo-license-maven-plugin.version>1.20</mojo-license-maven-plugin.version>
    <checkstyle.skip>true</checkstyle.skip>
    <protobuf-maven-plugin.version>0.5.0</protobuf-maven-plugin.version>
    <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
    <gpg.keyname>A1C4DAB9B220DBA0C277E945D6A1420D747D1EE0</gpg.keyname>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring-boot.version>2.4.13</spring-boot.version>
    <maven.test.skip>false</maven.test.skip>
    <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
    <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
    <license.skip>true</license.skip>
    <jib-maven-plugin.version>2.3.0</jib-maven-plugin.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
    <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <license-maven-plugin.version>3.0</license-maven-plugin.version>
    <maven-dependency-plugin.version>3.0.2</maven-dependency-plugin.version>
    <maven-assembly-plugin.version>3.0.0</maven-assembly-plugin.version>
    <maven-checkstyle-plugin.version>3.1.1</maven-checkstyle-plugin.version>
    <nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
    <maven-javadoc-plugin.version>3.0.0</maven-javadoc-plugin.version>
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <java.version>1.8</java.version>
    <image.publish.skip>true</image.publish.skip>
    <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
    <maven-shade-plugin.version>2.4.3</maven-shade-plugin.version>
    <flatten-maven-plugin.version>1.1.0</flatten-maven-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
    <p3c-pmd.version>1.3.6</p3c-pmd.version>
    <revision>1.5.1</revision>
  </properties>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven-deploy-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-shade-plugin</artifactId>
          <version>${maven-shade-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${maven-dependency-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${maven-checkstyle-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.xolstice.maven.plugins</groupId>
          <artifactId>protobuf-maven-plugin</artifactId>
          <version>${protobuf-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${license-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${mojo-license-maven-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
          <encoding>${project.build.sourceEncoding}</encoding>
          <parameters>true</parameters>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${maven-resources-plugin.version}</version>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven-jar-plugin.version}</version>
        <configuration>
          <archive>
            <addMavenDescriptor>true</addMavenDescriptor>
            <index>true</index>
            <manifest>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <Implementation-Build>${maven.build.timestamp}</Implementation-Build>
            </manifestEntries>
          </archive>
          <excludes>
            <exclude>**/META-INF/additional-spring-configuration-metadata.json</exclude>
            <exclude>protobuf/**</exclude>
            <exclude>**/*.proto</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>${maven-clean-plugin.version}</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>./</directory>
              <includes>
                <include>*-pom*.xml</include>
                <include>**/db_store/**</include>
                <include>**/sessionStore/**</include>
                <include>**/root.data</include>
              </includes>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>${flatten-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>flatten</id>
            <phase>process-resources</phase>
            <goals>
              <goal>flatten</goal>
            </goals>
          </execution>
          <execution>
            <id>flatten.clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <updatePomFile>true</updatePomFile>
          <flattenMode>resolveCiFriendliesOnly</flattenMode>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven-enforcer-plugin.version}</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.6.0,)</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <charset>UTF-8</charset>
                  <encoding>UTF-8</encoding>
                  <failOnError>false</failOnError>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <charset>UTF-8</charset>
              <encoding>UTF-8</encoding>
              <failOnError>false</failOnError>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>oss_seata</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
              <sslAllowAll>true</sslAllowAll>
              <stagingProgressPauseDurationSeconds>20</stagingProgressPauseDurationSeconds>
              <stagingProgressTimeoutMinutes>20</stagingProgressTimeoutMinutes>
              <detectBuildFailures>true</detectBuildFailures>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <keyname>A1C4DAB9B220DBA0C277E945D6A1420D747D1EE0</keyname>
                  <passphrase>!Seata123456</passphrase>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <repository>
          <id>oss_seata</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
          <id>oss_seata</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
      <properties>
        <os.detected.name>osx</os.detected.name>
        <image.publish.skip>true</image.publish.skip>
        <image.tags>${project.version},latest</image.tags>
        <os.detected.classifier>osx-x86_64</os.detected.classifier>
        <os.detected.arch>x86_64</os.detected.arch>
      </properties>
    </profile>
    <profile>
      <id>args-for-un-java8</id>
      <properties>
        <maven.surefire.argLine>--add-opens java.base/java.lang=ALL-UNNAMED
                    --add-opens java.base/java.net=ALL-UNNAMED
                    --add-opens java.base/java.math=ALL-UNNAMED
                    --add-opens java.base/java.text=ALL-UNNAMED
                    --add-opens java.base/java.util=ALL-UNNAMED
                    --add-opens java.base/java.util.regex=ALL-UNNAMED
                    --add-opens java.base/java.util.concurrent=ALL-UNNAMED

                    --add-opens java.sql/java.sql=ALL-UNNAMED
                    --add-opens java.sql.rowset/javax.sql.rowset.serial=ALL-UNNAMED

                    --illegal-access=permit
                    -Dillegal-access=permit</maven.surefire.argLine>
      </properties>
    </profile>
  </profiles>
</project>
