<?xml version="1.0" encoding="UTF-8"?>
<!--
~   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
~
~   http://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>
  <parent>
    <groupId>org.basepom</groupId>
    <artifactId>basepom-oss</artifactId>
    <version>43</version>
  </parent>
  <scm>
    <connection>scm:git:git://github.com/hgschmie/pg-embedded.git</connection>
    <developerConnection>scm:git:git@github.com:hgschmie/pg-embedded.git</developerConnection>
    <url>https://github.com/hgschmie/pg-embedded</url>
    <tag>pg-embedded-4.2</tag>
  </scm>
  <groupId>de.softwareforge.testing</groupId>
  <artifactId>pg-embedded</artifactId>
  <version>4.2</version>
  <description>Embedded PostgreSQL framework for testing and development use.</description>
  <url>https://pg-embedded.softwareforge.de/</url>
  <inceptionYear>2021</inceptionYear>
  <properties>
    <project.build.targetJdk>11</project.build.targetJdk>
    <project.moduleName>de.softwareforge.testing.postgres</project.moduleName>
    <basepom.test.timeout>1800</basepom.test.timeout>
    <basepom.release.profiles>basepom.oss-release,pg-embedded-release</basepom.release.profiles>
    <scm-publish.url>scm:git:https://github.com/hgschmie/pg-embedded.github.io.git</scm-publish.url>
    <maven.site.deploy.skip>true</maven.site.deploy.skip>
    <site-path>development</site-path>
    <!-- site requires full javadoc generation -->
    <basepom.javadoc.skip>false</basepom.javadoc.skip>
    <basepom.javadoc.show>protected</basepom.javadoc.show>
    <dep.plugin.jxr.version>3.0.0</dep.plugin.jxr.version>
    <dep.plugin.project-info-reports.version>3.1.1</dep.plugin.project-info-reports.version>
    <dep.plugin.inline.version>1.0.1</dep.plugin.inline.version>
    <dep.slf4j.version>1.7.32</dep.slf4j.version>
    <dep.guava.version>30.1.1-jre</dep.guava.version>
    <dep.flyway.version>8.1.0</dep.flyway.version>
    <dep.postgresql-jdbc.version>42.3.1</dep.postgresql-jdbc.version>
    <dep.junit5.version>5.8.1</dep.junit5.version>
    <dep.auto-value.version>1.8.2</dep.auto-value.version>
    <dep.maven-loader.version>2.0.1</dep.maven-loader.version>
    <dep.apache-commons-compress.version>1.21</dep.apache-commons-compress.version>
    <dep.xz.version>1.9</dep.xz.version>
    <dep.checkerframework.version>3.17.0</dep.checkerframework.version>
    <!-- MacOS Homebrew install location -->
    <pg-embedded.test.local-dir>/usr/local</pg-embedded.test.local-dir>
    <!-- really old local pg installations (such as pg 9.2) need 'unix_socket_directory' to run the LocalDirectoryPostgresTest -->
    <pg-embedded.test.unix-socket-dir>unix_socket_directories</pg-embedded.test.unix-socket-dir>
  </properties>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>
  <organization>
    <name>Henning Schmiedehausen</name>
    <url>https://github.com/hgschmie</url>
  </organization>
  <developers>
    <developer>
      <id>hgschmie</id>
      <name>Henning Schmiedehausen</name>
      <timezone>-8</timezone>
    </developer>
  </developers>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${dep.junit5.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${dep.slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.checkerframework</groupId>
        <artifactId>checker-qual</artifactId>
        <version>${dep.checkerframework.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>de.softwareforge.testing</groupId>
      <artifactId>maven-loader</artifactId>
      <version>${dep.maven-loader.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${dep.guava.version}</version>
    </dependency>
    <dependency>
      <groupId>org.flywaydb</groupId>
      <artifactId>flyway-core</artifactId>
      <version>${dep.flyway.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>${dep.postgresql-jdbc.version}</version>
    </dependency>
    <dependency>
      <groupId>com.github.spotbugs</groupId>
      <artifactId>spotbugs-annotations</artifactId>
      <version>${dep.spotbugs.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-commons</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.google.auto.value</groupId>
      <artifactId>auto-value-annotations</artifactId>
      <version>${dep.auto-value.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.google.auto.value</groupId>
      <artifactId>auto-value</artifactId>
      <version>${dep.auto-value.version}</version>
      <optional>true</optional>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>${dep.slf4j.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.zonky.test.postgres</groupId>
      <artifactId>embedded-postgres-binaries-darwin-amd64</artifactId>
      <version>13.4.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <systemProperties combine.children="append">
              <org.slf4j.simpleLogger.defaultLogLevel>INFO</org.slf4j.simpleLogger.defaultLogLevel>
            </systemProperties>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <executions>
            <execution>
              <id>enforce-convergence</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <!-- Ensure consistency -->
                  <dependencyConvergence />
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration combine.children="append">
            <links>
              <link>https://junit.org/junit5/docs/${dep.junit5.version}/api/</link>
              <link>https://javadoc.io/doc/com.google.guava/guava/${dep.guava.version}/</link>
              <link>https://javadoc.io/doc/com.github.spotbugs/spotbugs-annotations/${dep.spotbugs.version}</link>
            </links>
            <author>false</author>
            <detectJavaApiLink>true</detectJavaApiLink>
            <linksource>true</linksource>
            <nodeprecated>false</nodeprecated>
            <nohelp>true</nohelp>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <configuration>
            <archive>
              <manifestEntries combine.children="append">
                <Automatic-Module-Name>${project.moduleName}</Automatic-Module-Name>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.basepom.maven</groupId>
          <artifactId>inline-maven-plugin</artifactId>
          <version>${dep.plugin.inline.version}</version>
          <configuration>
            <prefix>de.softwareforge.testing</prefix>
            <hideClasses>true</hideClasses>
            <inlineDependencies>
              <inlineDependency>
                <artifact>org.apache.commons:commons-compress</artifact>
              </inlineDependency>
              <inlineDependency>
                <artifact>org.tukaani:xz</artifact>
              </inlineDependency>
            </inlineDependencies>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.skins</groupId>
            <artifactId>maven-fluido-skin</artifactId>
            <version>1.9</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-publish-plugin</artifactId>
        <executions>
          <execution>
            <id>publish-docs</id>
            <phase>site-deploy</phase>
            <goals>
              <goal>publish-scm</goal>
            </goals>
            <configuration>
              <serverId>github</serverId>
              <pubScmUrl>${scm-publish.url}</pubScmUrl>
              <scmBranch>main</scmBranch>
              <checkoutDirectory>${java.io.tmpdir}/gh-pages-publish/${project.name}</checkoutDirectory>
              <content>${project.build.directory}/site</content>
              <subDirectory>${site-path}</subDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.basepom.maven</groupId>
        <artifactId>inline-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>inline</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration combine.children="append">
          <links>
            <link>https://junit.org/junit5/docs/${dep.junit5.version}/api/</link>
            <link>https://javadoc.io/doc/com.google.guava/guava/${dep.guava.version}/</link>
            <link>https://javadoc.io/doc/com.github.spotbugs/spotbugs-annotations/${dep.spotbugs.version}</link>
          </links>
          <author>false</author>
          <detectJavaApiLink>true</detectJavaApiLink>
          <linksource>true</linksource>
          <nodeprecated>false</nodeprecated>
          <nohelp>true</nohelp>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
  <profiles>
    <profile>
      <id>pg-embedded-release</id>
      <properties>
        <site-path>release-${project.version}</site-path>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-java17</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireJavaVersion>
                      <version>[17,)</version>
                    </requireJavaVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
