<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2023 the original author or authors.

    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 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>com.ramanbabich.dbljc</groupId>
  <artifactId>pgljc-maven-plugin</artifactId>
  <version>0.1.0</version>
  <packaging>maven-plugin</packaging>
  <name>${project.groupId}:${project.artifactId}</name>
  <description>Postgres liquibase jooq codegen maven plugin (pgljc)</description>
  <properties>
    <checkstyle.version>10.12.0</checkstyle.version>
    <integration-test.maven-repo-dir>${project.build.directory}/integration-test/maven-repo</integration-test.maven-repo-dir>
    <java.version>17</java.version>
    <junit.version>5.9.3</junit.version>
    <license-maven-plugin.version>4.2</license-maven-plugin.version>
    <log4j.version>2.20.0</log4j.version>
    <maven-checkstyle-plugin.version>3.3.0</maven-checkstyle-plugin.version>
    <maven-clean-plugin.version>3.3.1</maven-clean-plugin.version>
    <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
    <maven-core.version>3.9.2</maven-core.version>
    <maven-failsafe-plugin.version>3.1.2</maven-failsafe-plugin.version>
    <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
    <maven-install-plugin.version>3.1.1</maven-install-plugin.version>
    <maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
    <maven-plugin-annotations.version>3.9.0</maven-plugin-annotations.version>
    <maven-plugin-api.version>3.9.2</maven-plugin-api.version>
    <maven-plugin-plugin.version>3.9.0</maven-plugin-plugin.version>
    <maven-release-plugin.version>3.0.1</maven-release-plugin.version>
    <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
    <maven-source-plugin.version>3.3.0</maven-source-plugin.version>
    <maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
    <maven-verifier.version>2.0.0-M1</maven-verifier.version>
    <mockito.version>5.4.0</mockito.version>
    <mojo-executor.version>2.4.0</mojo-executor.version>
    <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.currentYear>2023</project.currentYear>
    <project.owner>the original author or authors</project.owner>
    <slf4j.version>2.0.7</slf4j.version>
    <sortpom-maven-plugin.version>3.2.1</sortpom-maven-plugin.version>
    <testcontainers.version>1.18.3</testcontainers.version>
    <versions-maven-plugin.version>2.16.0</versions-maven-plugin.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>postgresql</artifactId>
      <version>${testcontainers.version}</version>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers</artifactId>
      <version>${testcontainers.version}</version>
    </dependency>
    <dependency>
      <groupId>org.twdata.maven</groupId>
      <artifactId>mojo-executor</artifactId>
      <version>${mojo-executor.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven-core.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven-plugin-api.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>${maven-plugin-annotations.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j2-impl</artifactId>
      <version>${log4j.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-verifier</artifactId>
      <version>${maven-verifier.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.ekryd.sortpom</groupId>
        <artifactId>sortpom-maven-plugin</artifactId>
        <version>${sortpom-maven-plugin.version}</version>
        <configuration>
          <createBackupFile>false</createBackupFile>
          <expandEmptyElements>false</expandEmptyElements>
          <keepBlankLines>false</keepBlankLines>
          <predefinedSortOrder>custom_1</predefinedSortOrder>
          <sortDependencies>scope,groupId,artifactId</sortDependencies>
          <sortModules>true</sortModules>
          <sortPlugins>groupId,artifactId</sortPlugins>
          <sortProperties>true</sortProperties>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>sort</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>
          <properties>
            <year>${project.currentYear}</year>
            <owner>${project.owner}</owner>
          </properties>
          <mapping>
            <java>JAVA_EXTRBLNK</java>
          </mapping>
          <defaultInlineHeaderStyles>
            <defaultInlineHeaderStyle>
              <name>java_extrblnk</name>
              <firstLine>/*</firstLine>
              <beforeEachLine xml:space="preserve"> * </beforeEachLine>
              <!--new line for endLine is intentional, do not change this.-->
              <endLine xml:space="preserve"> */
</endLine>
              <firstLineDetectionPattern>(\\s|\\t)*/\\*.*$</firstLineDetectionPattern>
              <lastLineDetectionPattern>.*\\*/(\\s|\\t)*$</lastLineDetectionPattern>
              <allowBlankLines>false</allowBlankLines>
              <multiLine>true</multiLine>
              <padLines>false</padLines>
            </defaultInlineHeaderStyle>
          </defaultInlineHeaderStyles>
          <licenseSets>
            <licenseSet>
              <basedir>${project.basedir}</basedir>
              <!--indentation of inline header is intentional, do not change this-->
              <inlineHeader><![CDATA[Copyright ${year} ${owner}.

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.]]></inlineHeader>
              <excludes>
                <exclude>README.adoc</exclude>
                <exclude>NOTICE.txt</exclude>
                <exclude>LICENSE.txt</exclude>
                <exclude>checkstyle.xml</exclude>
                <exclude>target/**</exclude>
                <exclude>**/log.txt</exclude>
              </excludes>
            </licenseSet>
          </licenseSets>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven-checkstyle-plugin.version}</version>
        <configuration>
          <configLocation>checkstyle.xml</configLocation>
          <failsOnError>true</failsOnError>
          <violationSeverity>warning</violationSeverity>
          <consoleOutput>true</consoleOutput>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>validate</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>process-classes</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>${maven-clean-plugin.version}</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>src/test/resources/integration-tests</directory>
              <includes>
                <include>**/target/**</include>
                <include>**/log.txt</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <compilerArgs>
            <arg>-parameters</arg>
          </compilerArgs>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>${maven-plugin-plugin.version}</version>
        <configuration>
          <helpPackageName>${project.groupId}.pgljcmavenplugin</helpPackageName>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${maven-release-plugin.version}</version>
        <configuration>
          <releaseProfiles>release</releaseProfiles>
          <tagNameFormat>v@{project.version}</tagNameFormat>
          <preparationProfiles>integration-test</preparationProfiles>
          <scmDevelopmentCommitComment>build: prepare for next development iteration</scmDevelopmentCommitComment>
          <scmReleaseCommitComment>build: prepare release @{releaseLabel}</scmReleaseCommitComment>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${maven-resources-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <phase>prepare-package</phase>
            <configuration>
              <resources>
                <resource>
                  <directory>${project.basedir}</directory>
                  <includes>
                    <include>LICENSE.txt</include>
                    <include>NOTICE.txt</include>
                  </includes>
                  <filtering>true</filtering>
                </resource>
              </resources>
              <outputDirectory>${project.build.outputDirectory}/META-INF</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <version>${versions-maven-plugin.version}</version>
        <configuration>
          <!--<allowMajorUpdates>false</allowMajorUpdates>-->
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>${nexus-staging-maven-plugin.version}</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>false</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <url>https://github.com/raman-babich/dbljc-pgljc-maven-plugin</url>
  <inceptionYear>2023</inceptionYear>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Raman Babich</name>
      <email>ramanbabich@gmail.com</email>
      <url>https://github.com/raman-babich</url>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git@github.com:raman-babich/dbljc-pgljc-maven-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:raman-babich/dbljc-pgljc-maven-plugin.git</developerConnection>
    <url>https://github.com/raman-babich/dbljc-pgljc-maven-plugin</url>
    <tag>v0.1.0</tag>
  </scm>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  <profiles>
    <profile>
      <id>integration-test</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${maven-failsafe-plugin.version}</version>
            <configuration>
              <systemPropertyVariables>
                <pgljc-maven-plugin.version>${project.version}</pgljc-maven-plugin.version>
                <verifier.local-repo>${integration-test.maven-repo-dir}</verifier.local-repo>
              </systemPropertyVariables>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <version>${maven-install-plugin.version}</version>
            <configuration>
              <file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
              <localRepositoryPath>${integration-test.maven-repo-dir}</localRepositoryPath>
            </configuration>
            <executions>
              <execution>
                <id>install-plugin-to-local-project-repo</id>
                <goals>
                  <goal>install-file</goal>
                </goals>
                <phase>pre-integration-test</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <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>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <configuration>
              <bottom>Copyright ${project.currentYear} ${project.owner}.</bottom>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
