<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.codingapi.dbstream</groupId>
    <artifactId>dbstream-driver</artifactId>
    <version>1.0.2</version>

    <url>https://github.com/codingapi/dbstream-driver</url>
    <name>dbstream-driver</name>
    <description>dbstream-driver</description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>8</java.version>

        <!-- plugin properties-->
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
        <maven.compile.source>8</maven.compile.source>
        <maven.compile.target>8</maven.compile.target>
        <maven.source.plugin>3.0.1</maven.source.plugin>
        <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
        <maven.javadoc.plugin>3.6.1</maven.javadoc.plugin>
        <nexus.staging.maven.plugin>1.6.13</nexus.staging.maven.plugin>
        <maven.gpg.plugin>3.1.0</maven.gpg.plugin>
        <maven.jacoco.version>0.8.12</maven.jacoco.version>
        <maven.openclover.version>4.5.2</maven.openclover.version>
        <maven.source.version>3.3.1</maven.source.version>
        <maven.sonatype.version>0.8.0</maven.sonatype.version>
        <maven.javadoc.version>3.6.3</maven.javadoc.version>
        <maven.gpg.version>3.0.1</maven.gpg.version>

        <!-- project dependencies properties-->
        <lombok.version>1.18.42</lombok.version>
        <jsqlparser.version>4.9</jsqlparser.version>

        <!-- test dependencies properties-->
        <springboot.version>2.7.18</springboot.version>
        <h2.version>2.2.222</h2.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.github.jsqlparser</groupId>
            <artifactId>jsqlparser</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>${springboot.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>${h2.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>${springboot.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
            </dependency>

            <dependency>
                <groupId>com.github.jsqlparser</groupId>
                <artifactId>jsqlparser</artifactId>
                <version>${jsqlparser.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <scm>
        <connection>scm:git:https://github.com/codingapi/dbstream-driver.git</connection>
        <developerConnection>scm:git:https://github.com/codingapi/dbstream-driver.git</developerConnection>
        <url>https://https://github.com/codingapi/dbstream-driver</url>
        <tag>v${project.version}</tag>
    </scm>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>lorne</name>
            <email>wangliang@codingapi.com</email>
            <roles>
                <role>developer</role>
            </roles>
            <timezone>+8</timezone>
        </developer>
    </developers>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${maven.compile.source}</source>
                    <target>${maven.compile.target}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <compilerArgument>-Xlint:deprecation</compilerArgument>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>

        <!-- mvn clean test -P travis-->
        <profile>
            <id>travis</id>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${maven.jacoco.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.openclover</groupId>
                        <artifactId>clover-maven-plugin</artifactId>
                        <version>${maven.openclover.version}</version>
                        <configuration>
                            <generateHtml>true</generateHtml>
                            <generateXml>true</generateXml>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>

        <profile>
            <!-- mvn clean deploy -P ossrh  -->
            <!-- mvn clean deploy -P ossrh -Dgpg.passphrase="你的GPG密码" -->
            <!-- gpg: signing failed: Inappropriate ioctl for device -->
            <!-- fix command : export GPG_TTY=$(tty)  -->
            <!-- https://github.com/keybase/keybase-issues/issues/2798 -->
            <id>ossrh</id>


            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven.source.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${maven.sonatype.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven.javadoc.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalOptions>
                                <additionalOption>-Xdoclint:none</additionalOption>
                            </additionalOptions>
                        </configuration>
                    </plugin>


                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>


</project>
