<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>tw.com.softleader.cloud.tools</groupId>
  <artifactId>jib-jvm-flags-extension-maven</artifactId>
  <version>1.0.2</version>
  <name>JVM Flags Extension for Jib Maven Plugin</name>
  <description>Write JVM Flags to file</description>

  <url>https://github.com/softleader/jib-jvm-flags-extension-maven</url>
  <inceptionYear>2024</inceptionYear>
  <organization>
    <name>SoftLeader</name>
    <url>http://www.softleader.com.tw</url>
  </organization>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Matt Ho</name>
      <email>matt.ho@softleader.com.tw</email>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git://github.com/softleader/jib-jvm-flags-extension-maven.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/softleader/jib-jvm-flags-extension-maven.git</developerConnection>
    <url>https://github.com/softleader/jib-jvm-flags-extension-maven</url>
  </scm>

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <java.version>11</java.version>
    <maven.compiler.release>${java.version}</maven.compiler.release>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <skip.formatting>false</skip.formatting>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
    <maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
    <spotless-maven-plugin.version>2.41.1</spotless-maven-plugin.version>
    <license-maven-plugin.version>4.1</license-maven-plugin.version>
    <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
    <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
    <maven-site-plugin.version>3.8.2</maven-site-plugin.version>
    <maven-source-plugin.version>3.2.0</maven-source-plugin.version>

    <jib-maven-plugin-extension-api.version>0.4.0</jib-maven-plugin-extension-api.version>
    <assertj-core.version>3.11.1</assertj-core.version>
    <junit-jupiter.version>5.9.1</junit-jupiter.version>
    <lombok.version>1.18.30</lombok.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.google.cloud.tools</groupId>
      <artifactId>jib-maven-plugin-extension-api</artifactId>
      <version>${jib-maven-plugin-extension-api.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${lombok.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit-jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj-core.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>spring-milestones</id>
      <url>https://repo.spring.io/milestone</url>
    </repository>
    <repository>
      <id>spring-release</id>
      <url>https://repo.spring.io/release</url>
    </repository>
  </repositories>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <executable>${java.version}</executable>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless-maven-plugin.version}</version>
        <configuration>
          <applySkip>${skip.formatting}</applySkip>
          <java>
            <googleJavaFormat></googleJavaFormat>
          </java>
          <pom>
            <sortPom></sortPom>
          </pom>
        </configuration>
        <executions>
          <execution>
            <id>apply</id>
            <goals>
              <goal>apply</goal>
            </goals>
            <phase>validate</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-maven-plugin.version}</version>
        <configuration>
          <licenseSets>
            <licenseSet>
              <header>copyright-license-header-template.txt</header>
              <excludes>
                <exclude>**/README</exclude>
                <exclude>.editorconfig</exclude>
                <exclude>Makefile</exclude>
                <exclude>Jenkinsfile*</exclude>
                <exclude>**/*.xml</exclude>
                <exclude>src/test/resources/**</exclude>
                <exclude>src/main/resources/**</exclude>
              </excludes>
            </licenseSet>
          </licenseSets>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>format</goal>
            </goals>
            <phase>process-sources</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</version>
            <configuration>
              <attach>true</attach>
            </configuration>
            <executions>
              <execution>
                <id>package</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <quiet>true</quiet>
                  <doclint>none</doclint>
                  <show>package</show>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>${maven-site-plugin.version}</version>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
                <configuration>
                  <keyname>${gpg.keyname}</keyname>
                  <passphraseServerId>${gpg.keyname}</passphraseServerId>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <configuration>
              <quiet>true</quiet>
              <doclint>none</doclint>
              <show>package</show>
            </configuration>
          </plugin>
        </plugins>
      </reporting>
    </profile>
  </profiles>
</project>
