<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>net.hydromatic</groupId>
    <artifactId>parent</artifactId>
    <version>0.1</version>
  </parent>

  <groupId>sqlline</groupId>
  <artifactId>sqlline</artifactId>
  <packaging>jar</packaging>
  <version>1.9.0</version>
  <name>sqlline</name>
  <description>Shell for issuing SQL to relational databases via JDBC</description>
  <url>https://github.com/julianhyde/sqlline</url>
  <inceptionYear>2002</inceptionYear>
  <organization>
    <name>Julian Hyde</name>
    <url>https://github.com/julianhyde</url>
  </organization>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <top.dir>${project.basedir}</top.dir>

    <!-- The following list is sorted. -->
    <checkstyle.version>8.23</checkstyle.version>
    <docbkx-maven-plugin.version>2.0.17</docbkx-maven-plugin.version>
    <forbiddenapis.version>2.6</forbiddenapis.version>
    <h2.version>1.4.199</h2.version>
    <hamcrest.version>2.1</hamcrest.version>
    <hsqldb.version>2.5.0</hsqldb.version>
    <jline.version>3.12.1</jline.version>
    <jmockit.version>1.48</jmockit.version>
    <junit.version>5.5.1</junit.version>
    <maven-assembly-plugin.version>3.1.1</maven-assembly-plugin.version>
    <maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
    <maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
    <maven-jar-plugin.version>3.1.2</maven-jar-plugin.version>
    <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
    <maven-javadoc-plugin.additionalOptions>-html5</maven-javadoc-plugin.additionalOptions>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>
    <maven-site-plugin.version>3.8.2</maven-site-plugin.version>
    <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
    <scott-data-hsqldb.version>0.1</scott-data-hsqldb.version>
    <skip.docbkx>false</skip.docbkx>
  </properties>

  <licenses>
    <license>
      <name>Modified BSD License</name>
      <url>https://opensource.org/licenses/BSD-3-Clause</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <site>
      <id>sqlline.website</id>
      <name>SQLLine Website</name>
      <url>file:/home/jhyde/web2/sqlline</url>
    </site>
  </distributionManagement>

  <issueManagement>
    <system>github</system>
    <url>https://github.com/julianhyde/sqlline/issues</url>
  </issueManagement>

  <scm>
    <connection>scm:git:git://github.com/julianhyde/sqlline.git</connection>
    <developerConnection>scm:git:git@github.com:julianhyde/sqlline.git</developerConnection>
    <url>https://github.com/julianhyde/sqlline/tree/master</url>
    <tag>sqlline-1.9.0</tag>
  </scm>

  <mailingLists>
    <mailingList>
      <name>sqlline-dev</name>
      <archive>https://groups.google.com/group/sqlline-dev/topics</archive>
      <subscribe>https://groups.google.com/group/sqlline-dev/subscribe</subscribe>
      <unsubscribe>https://groups.google.com/group/sqlline-dev/subscribe</unsubscribe>
      <post>https://groups.google.com/group/sqlline-dev/post</post>
    </mailingList>
  </mailingLists>

  <repositories />

  <build>
    <plugins>
      <plugin>
        <!-- Generate manual.html from manual.xml. Then you must manually
             generate manual.txt by copy-pasting from manual.html in a web
             browser. -->
        <groupId>com.agilejava.docbkx</groupId>
        <artifactId>docbkx-maven-plugin</artifactId>
        <version>${docbkx-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>generate-html</goal>
              <goal>generate-xhtml</goal>
              <goal>generate-xhtml5</goal>
              <goal>generate-manpages</goal>
            </goals>
            <phase>validate</phase>
          </execution>
        </executions>
        <configuration>
          <entities>
            <entity>
              <name>VERSION</name>
              <value>${project.version}</value>
            </entity>
          </entities>
          <includes>manual.xml</includes>
          <skip>${skip.docbkx}</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>de.thetaphi</groupId>
        <artifactId>forbiddenapis</artifactId>
        <configuration>
          <!-- if the used Java version is too new, don't fail, just do nothing: -->
          <failOnUnsupportedJava>false</failOnUnsupportedJava>
          <bundledSignatures>
            <!--
              This will automatically choose the right
              signatures based on 'maven.compiler.target':
            -->
            <bundledSignature>jdk-unsafe</bundledSignature>
            <bundledSignature>jdk-deprecated</bundledSignature>
            <!-- disallow undocumented classes like sun.misc.Unsafe: -->
            <bundledSignature>jdk-non-portable</bundledSignature>
          </bundledSignatures>
          <signaturesFiles>
            <signaturesFile>${top.dir}/src/main/config/forbidden-apis/signatures.txt</signaturesFile>
          </signaturesFiles>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
              <goal>testCheck</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven-checkstyle-plugin.version}</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <configuration>
              <configLocation>${top.dir}/src/main/config/checkstyle/checker.xml</configLocation>
              <suppressionsLocation>${top.dir}/src/main/config/checkstyle/suppressions.xml</suppressionsLocation>
              <consoleOutput>true</consoleOutput>
              <headerLocation>${top.dir}/src/main/config/checkstyle/header.txt</headerLocation>
              <failOnViolation>true</failOnViolation>
              <includeTestSourceDirectory>true</includeTestSourceDirectory>
            </configuration>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven-enforcer-plugin.version}</version>
        <executions>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>[1.8,)</version>
                </requireJavaVersion>
                <requireMavenVersion>
                  <version>[3.2.1,)</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven-javadoc-plugin.version}</version>
        <configuration>
          <additionalOptions>${maven-javadoc-plugin.additionalOptions}</additionalOptions>
          <show>public</show>
          <source>${maven.compiler.source}</source>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!--  To allow JMockit to be loaded first in surefire -->
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${maven-dependency-plugin.version}</version>
        <executions>
          <execution>
            <id>getClasspathFilenames</id>
            <goals>
              <goal>properties</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>${maven-project-info-reports-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <localCheckout>true</localCheckout>
          <pushChanges>false</pushChanges>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
           <execution>
              <goals>
                <goal>jar</goal>
              </goals>
           </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <useManifestOnlyJar>false</useManifestOnlyJar>
          <systemPropertyVariables>
            <!-- Run tests in Turkish to make sure that they don't depend on
                 locale. Turkish is a notoriously tricky locale. -->
            <user.language>TR</user.language>
            <user.country>tr</user.country>
          </systemPropertyVariables>
          <argLine>-Xmx1024m -javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven-jar-plugin.version}</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <mainClass>sqlline.SqlLine</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>${maven-assembly-plugin.version}</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <mainClass>sqlline.SqlLine</mainClass>
            </manifest>
          </archive>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>${maven-site-plugin.version}</version>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>de.thetaphi</groupId>
          <artifactId>forbiddenapis</artifactId>
          <version>${forbiddenapis.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.jline</groupId>
      <artifactId>jline-terminal</artifactId>
      <version>${jline.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jline</groupId>
      <artifactId>jline-reader</artifactId>
      <version>${jline.version}</version>
    </dependency>
    <!-- required to have terminal with advanced capabilities on Windows -->
    <dependency>
      <groupId>org.jline</groupId>
      <artifactId>jline-terminal-jansi</artifactId>
      <version>${jline.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jline</groupId>
      <artifactId>jline-terminal-jna</artifactId>
      <version>${jline.version}</version>
    </dependency>
    <!-- required to have terminal with advanced capabilities on Windows -->
    <dependency>
      <groupId>org.jline</groupId>
      <artifactId>jline-builtins</artifactId>
      <version>${jline.version}</version>
    </dependency>
    <dependency>
      <!-- JMockit needs to be on class path before JUnit. -->
      <groupId>org.jmockit</groupId>
      <artifactId>jmockit</artifactId>
      <version>${jmockit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>net.hydromatic</groupId>
      <artifactId>scott-data-hsqldb</artifactId>
      <version>${scott-data-hsqldb.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <version>${hsqldb.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>${h2.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <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>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>java8</id>
      <activation>
        <jdk>1.8</jdk>
      </activation>
      <properties>
        <!-- Javadoc only has a "-html5" flag in JDK 9 and higher. -->
        <maven-javadoc-plugin.additionalOptions />
      </properties>
    </profile>
  </profiles>
</project>
