<?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>
    <name>relay-jdbc</name>
    <url>https://github.com/peter-gergely-horvath/relay-jdbc</url>

    <groupId>com.github.peter-gergely-horvath</groupId>
    <artifactId>relay-jdbc</artifactId>
    <version>3.0.0</version>

    <licenses>
        <license>
            <name>LGPL-2.1</name>
            <url>https://opensource.org/licenses/LGPL-2.1</url>
            <distribution>repo</distribution>
            <comments>GNU Lesser General Public License version 2.1</comments>
        </license>
    </licenses>

    <scm>
        <connection>
            scm:git:https://github.com/peter-gergely-horvath/relay-jdbc.git
        </connection>
        <developerConnection>
            scm:git:https://github.com/peter-gergely-horvath/relay-jdbc.git
        </developerConnection>
        <tag>HEAD</tag>
        <url>https://github.com/peter-gergely-horvath/relay-jdbc</url>
    </scm>

    <developers>
        <developer>
            <id>peter-gergely-horvath</id>
            <name>Peter G. Horvath</name>
            <email>peter.gergely.horvath@gmail.com</email>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>Europe/Vienna</timezone>
        </developer>
    </developers>

    <issueManagement>
        <system>GitHub issue tracker of relay-jdbc project</system>
        <url>https://github.com/peter-gergely-horvath/relay-jdbc/issues</url>
    </issueManagement>

    <description>
        relay-jdbc allows a JDBC connection to be relayed through an intermediate
        relay server: it is both a JDBC driver (client) and a JDBC relay server.

        It is a fork of https://github.com/AugeoSoftware/VJDBC project, where
        Aleksei Yu. Semenov has implemented a number of brilliant improvements
        of the orignal VJDBC project hosted on http://vjdbc.sourceforge.net
        Original Developers were: Hunter Payne (sfcat@users.sourceforge.net)
        and Michael Link (urmeli@users.sourceforge.net).
        For all pre-existing code, credits go to the original respective author.

        This product brings the original VJDBC concept further and (apart from code
        quality improvements and bug fixes) implements complete separation of the
        underlying transport mechanism, introducing support for connecting directly
        through a SSH pipe, where the relay server interacts with the client through
        standard I/O pipes.

        The re-designed transport architecture supports easy development of new
        transport implementations, allowing this JDBC relay to be quickly adapted
        to a variety of exotic environments.
    </description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <spotbugs-maven-plugin.version>3.1.11</spotbugs-maven-plugin.version>
        <xml-maven-plugin.version>1.0</xml-maven-plugin.version>
        <maven-surefire-plugin.version>2.20</maven-surefire-plugin.version>

        <!-- Maven plugin versions -->
        <maven-project-info-reports-plugin.version>2.8.1</maven-project-info-reports-plugin.version>
        <maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
        <maven-jxr-plugin.version>2.5</maven-jxr-plugin.version>
        <maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
        <maven-pmd-plugin.version>3.6</maven-pmd-plugin.version>
        <xml-maven-plugin.version>1.0</xml-maven-plugin.version>
        <maven-source-plugin.version>3.0.0</maven-source-plugin.version>
        <maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
            <version>9.4.20.v20190813</version>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.199</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.7.0</version>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils-core</artifactId>
            <version>1.7.0</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>1.7</version>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>com.jcraft</groupId>
            <artifactId>jsch</artifactId>
            <version>0.1.55</version>
        </dependency>

        <dependency> <!--  used in query filters -->
            <groupId>oro</groupId>
            <artifactId>oro</artifactId>
            <version>2.0.8</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.servlet</artifactId>
            <version>3.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.esotericsoftware.kryo</groupId>
            <artifactId>kryo</artifactId>
            <version>2.24.0</version>
            <exclusions>
                <exclusion>
                    <groupId>com.esotericsoftware.minlog</groupId>
                    <artifactId>minlog</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>


    <profiles>

        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-clean-plugin</artifactId>
                        <version>2.4.1</version>
                        <configuration>
                            <failOnError>false</failOnError>
                            <filesets>
                            </filesets>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>2.3.2</version>
                        <configuration>
                            <verbose>true</verbose>
                            <fork>true</fork>
                            <compilerVersion>1.6</compilerVersion>
                            <source>1.8</source>
                            <target>1.8</target>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                        <version>${spotbugs-maven-plugin.version}</version>
                        <configuration>
                            <!-- Enables analysis which takes more memory but finds more bugs.
                                If you run out of memory, changes the value of the effort element to 'Low'. -->
                            <effort>Max</effort>

                            <!-- Location of SpotBugs exclude filter file -->
                            <excludeFilterFile>build-config/spotbugs-exclude.xml</excludeFilterFile>


                            <!-- Build shall fail if problems are found -->
                            <failOnError>true</failOnError>

                            <!-- Reports all bugs (other values are medium and max) -->
                            <threshold>Low</threshold>

                            <!-- Produces XML report -->
                            <xmlOutput>true</xmlOutput>

                            <!-- Configures the directory in which the XML report is created -->
                            <spotbugsXmlOutputDirectory>${project.build.directory}/sportbugs
                            </spotbugsXmlOutputDirectory>
                        </configuration>
                        <executions>
                            <!-- Ensures that FindBugs inspects source code when project is compiled. -->
                            <execution>
                                <id>analyze-compile</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>xml-maven-plugin</artifactId>
                        <version>${xml-maven-plugin.version}</version>
                        <configuration>
                            <transformationSets>
                                <transformationSet>
                                    <!-- Configures the source directory of XML files. -->
                                    <dir>${project.build.directory}/sportbugs</dir>
                                    <includes>
                                        <!-- only transform findbugsXml.xml to generate FindBugs HTML report -->
                                        <include>spotbugsXml.xml</include>
                                    </includes>

                                    <!-- Configures the directory in which the FindBugs report is written. -->
                                    <outputDir>${project.build.directory}/sportbugs</outputDir>

                                    <!-- Selects the used stylesheet. -->
                                    <!-- <stylesheet>fancy-hist.xsl</stylesheet> -->
                                    <!--<stylesheet>default.xsl</stylesheet> -->
                                    <!--<stylesheet>plain.xsl</stylesheet> -->
                                    <stylesheet>fancy.xsl</stylesheet>
                                    <!--<stylesheet>summary.xsl</stylesheet> -->
                                    <fileMappers>
                                        <!-- Configures the file extension of the output files. -->
                                        <fileMapper
                                                implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
                                            <targetExtension>.html</targetExtension>
                                        </fileMapper>
                                    </fileMappers>
                                </transformationSet>
                            </transformationSets>
                        </configuration>
                        <executions>
                            <!-- Ensures that the XSLT transformation is run when the project
                                is compiled. -->
                            <execution>
                                <phase>compile</phase>
                                <goals>
                                    <goal>transform</goal>
                                </goals>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>com.github.spotbugs</groupId>
                                <artifactId>spotbugs</artifactId>
                                <version>3.1.12</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>3.2.1</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                                <configuration>
                                    <transformers>
                                        <transformer
                                                implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                            <mainClass>com.github.relayjdbc.server.Main</mainClass>
                                        </transformer>

                                        <transformer
                                                implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer">
                                        </transformer>
                                    </transformers>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.13</version>
                        <configuration>
                            <includes>
                                <include>**/SQLExceptionHelperTest.java</include>
                            </includes>
                            <excludes>
                                <exclude>**/junit/**/*.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

        </profile>

        <profile>
            <id>maven-repo-promotion</id>
            <activation>
                <property>
                    <name>maven-repo-promotion</name>
                    <value>true</value>
                </property>
            </activation>

            <build>
                <plugins>

                    <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</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>
                            </execution>
                        </executions>
                    </plugin>


                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.3</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
    </profiles>

    <build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
            <includes>
                <include>**/*.prop</include>
            </includes>
        </resource>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>false</filtering>
            <includes>
                <include>META-INF/services/java.sql.Driver</include>
            </includes>
        </resource>
        <resource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
            <excludes>
                <exclude>**/*.prop</exclude>
            </excludes>
        </resource>
    </resources>
    </build>


    <reporting>
        <plugins>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.13</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <targetjdk>1.6</targetjdk>
                    <rulesets>
                        <ruleset>/rulesets/basic.xml</ruleset>
                        <ruleset>/rulesets/controversial.xml</ruleset>
                    </rulesets>
                    <format>xml</format>
                    <linkXref>true</linkXref>
                    <sourceEncoding>utf-8</sourceEncoding>
                    <minimumTokens>100</minimumTokens>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-changes-plugin</artifactId>
                <version>2.6</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>jira-report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>taglist-maven-plugin</artifactId>
                <version>2.4</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.5.2</version>
                <configuration>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

</project>
