<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Original Author -> Harry Yang (taketoday@foxmail.com) https://taketoday.cn
  ~ Copyright © TODAY & 2017 - 2023 All Rights Reserved.
  ~
  ~ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER
  ~
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program.  If not, see [http://www.gnu.org/licenses/]
  -->
<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>
  <groupId>cn.taketoday</groupId>
  <artifactId>today-infrastructure-build</artifactId>
  <version>4.0.0-Draft.3</version>
  <packaging>pom</packaging>
  <name>today-infrastructure-build</name>
  <description>TODAY Infrastructure build</description>
  <url>https://github.com/TAKETODAY/today-infrastructure</url>
  <organization>
    <name>TODAY Tech</name>
    <url>https://taketoday.cn</url>
  </organization>
  <licenses>
    <license>
      <name>GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007</name>
      <url>https://www.gnu.org/licenses/gpl.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Harry Yang</name>
      <email>taketoday@foxmail.com</email>
      <url>https://taketoday.cn</url>
    </developer>
  </developers>
  <scm>
    <developerConnection>Harry Yang</developerConnection>
    <tag>dependency-injection, aspect-oriented-programing, web-framework</tag>
    <url>https://github.com/TAKETODAY/today-infrastructure.git</url>
  </scm>
  <distributionManagement>
    <repository>
      <id>release</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <maven.site.skip>true</maven.site.skip>
    <cmd-line>--add-opens java.base/java.io=ALL-UNNAMED
      --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.base/java.lang.reflect=ALL-UNNAMED
      --add-opens java.sql/java.sql=ALL-UNNAMED
      --add-opens java.sql.rowset/javax.sql.rowset.serial=ALL-UNNAMED

      -Djava.awt.headless=true
      -Dio.netty.leakDetection.level=paranoid
      -Dio.netty5.leakDetectionLevel=paranoid
      -Dio.netty5.leakDetection.targetRecords=32
      -Dio.netty5.buffer.lifecycleTracingEnabled=true
      -Dio.netty5.buffer.leakDetectionEnabled=true</cmd-line>
    <asciidoctorj.version>2.5.2</asciidoctorj.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>17</java.version>
    <asciidoctorj.pdf.version>1.6.0</asciidoctorj.pdf.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <jruby.version>9.2.19.0</jruby.version>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <revision>4.0.0-Draft.3</revision>
    <site.output.dir>${project.build.directory}/staging</site.output.dir>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <revisiondate>${maven.build.timestamp}</revisiondate>
    <status>DRAFT</status>
  </properties>
  <build>
    <defaultGoal>compile</defaultGoal>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
            <release>${java.version}</release>
            <compilerVersion>${java.version}</compilerVersion>
            <encoding>UTF-8</encoding>
            <compilerArgs>
              <arg>-parameters</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.2.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.2.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.3.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
        </plugin>
        <plugin>
          <groupId>org.eluder.coveralls</groupId>
          <artifactId>coveralls-maven-plugin</artifactId>
          <version>4.3.0</version>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.8</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Extension-Name>today.infrastructure</Extension-Name>
              <Implementation-Build>${maven.build.timestamp}</Implementation-Build>
              <Implementation-Version>${project.version}</Implementation-Version>
              <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
              <Implementation-Vendor-Id>cn.taketoday</Implementation-Vendor-Id>
              <Export-Package>cn.taketoday.*</Export-Package>
              <Automatic-Module-Name>today.infrastructure</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <quiet>true</quiet>
          <source>${java.version}</source>
          <release>${java.version}</release>
          <charset>UTF-8</charset>
          <encoding>UTF-8</encoding>
          <docencoding>UTF-8</docencoding>
          <failOnError>false</failOnError>
          <failOnWarnings>false</failOnWarnings>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>1.1.0</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-surefire-plugin</artifactId>
        <configuration>
          <argLine>-DtestGroups=all ${cmd-line}</argLine>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>docs</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctor-maven-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
              <execution>
                <id>asciidoc-to-html</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <backend>html5</backend>
                  <sourceDirectory>${basedir}/docs</sourceDirectory>
                  <outputFile>${project.build.directory}/generated-docs/index.html</outputFile>
                  <attributes>
                    <source-highlighter>coderay</source-highlighter>
                    <imagesdir>images</imagesdir>
                    <doctype>book</doctype>
                    <status>${status}</status>
                    <data-uri />
                    <icons>font</icons>
                    <toc>left</toc>
                    <icons>font</icons>
                    <sectanchors>true</sectanchors>
                    <idprefix />
                    <idseparator>-</idseparator>
                    <docinfo1>true</docinfo1>
                  </attributes>
                </configuration>
              </execution>
              <execution>
                <id>asciidoc-to-pdf</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <backend>pdf</backend>
                  <sourceDirectory>${basedir}/docs</sourceDirectory>
                  <outputFile>${project.build.directory}/generated-docs/today-infrastructure-${project.version}.pdf</outputFile>
                  <attributes>
                    <source-highlighter>coderay</source-highlighter>
                    <imagesdir>images</imagesdir>
                    <pdf-stylesdir>${project.basedir}/docs/theme</pdf-stylesdir>
                    <pdf-style>today</pdf-style>
                    <doctype>book</doctype>
                    <status>${status}</status>
                    <data-uri />
                    <icons>font</icons>
                    <pagenums />
                    <toc />
                    <icons>font</icons>
                    <sectanchors>true</sectanchors>
                    <idprefix />
                    <idseparator>-</idseparator>
                    <docinfo1>true</docinfo1>
                    <embedAssets>true</embedAssets>
                  </attributes>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.jruby</groupId>
                <artifactId>jruby-complete</artifactId>
                <version>${jruby.version}</version>
              </dependency>
              <dependency>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctorj</artifactId>
                <version>${asciidoctorj.version}</version>
              </dependency>
              <dependency>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctorj-pdf</artifactId>
                <version>${asciidoctorj.pdf.version}</version>
              </dependency>
            </dependencies>
            <configuration>
              <sourceDocumentName>index.adoc</sourceDocumentName>
              <attributes>
                <revnumber>${project.version}</revnumber>
                <revremark>${status}</revremark>
                <revdate>${revisiondate}</revdate>
              </attributes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>coverage</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.2</version>
            <configuration>
              <argLine>${argLine} -Dcoverage=true -DtestGroups=all ${cmd-line}</argLine>
              <excludedGroups>failing-test-case</excludedGroups>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.eluder.coveralls</groupId>
            <artifactId>coveralls-maven-plugin</artifactId>
            <dependencies>
              <dependency>
                <groupId>jakarta.xml.bind</groupId>
                <artifactId>jakarta.xml.bind-api</artifactId>
                <version>2.3.3</version>
              </dependency>
            </dependencies>
            <configuration>
              <jacocoReports>${project.build.directory}/jacoco/jacoco.xml</jacocoReports>
            </configuration>
          </plugin>
          <plugin>
            <groupId>cn.taketoday</groupId>
            <artifactId>today-infra-maven-plugin</artifactId>
            <version>4.0.0-Draft.3</version>
            <executions>
              <execution>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <destFile>${project.parent.build.directory}/jacoco/jacoco-unit.exec</destFile>
              <formats>XML,HTML</formats>
              <append>true</append>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.13</version>
            <extensions>true</extensions>
            <executions>
              <execution>
                <id>injected-nexus-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
                <configuration>
                  <serverId>sonatype-nexus</serverId>
                  <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                  <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <serverId>sonatype-nexus</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </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>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release-snapshot</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.13</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>sonatype-nexus</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </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>
              </execution>
            </executions>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
