<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.4paradigm.openmldb</groupId>
    <artifactId>openmldb-parent</artifactId>
    <packaging>pom</packaging>
    <name>openmldb</name>
    <version>0.4.4-hotfix1</version>
    <modules>
        <module>hybridse-sdk</module>
        <module>hybridse-native</module>
        <module>hybridse-proto</module>
        <module>openmldb-jdbc</module>
        <module>openmldb-native</module>
        <module>openmldb-common</module>

        <module>openmldb-batchjob</module>
        <module>openmldb-taskmanager</module>
        <module>openmldb-batch</module>
        <module>openmldb-spark-connector</module>
    </modules>
    <description>OpenMLDB is an open-source database that is designed and optimized to enable data integrity and efficiency for machine learning driven applications. In addition to 10x faster ML application landing experience, OpenMLDB provides unified computing and storage engines to reduce the complexity and cost of development and operation.</description>
    <url>https://github.com/4paradigm/OpenMLDB</url>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>dl239</id>
            <name>jeremy</name>
            <email>denglong@4paradigm.com</email>
            <url>https://github.com/dl239</url>
            <organization>4Paradigm</organization>
            <organizationUrl>https://www.4paradigm.com/</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git@github.com:4paradigm/OpenMLDB.git</connection>
        <developerConnection>scm:git:ssh://git@github.com:4paradigm/OpenMLDB.git</developerConnection>
        <tag>HEAD</tag>
        <url>https://github.com/4paradigm/OpenMLDB</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <scala.version>2.12.8</scala.version>
        <scala.binary.version>2.12</scala.binary.version>
        <spark.version>3.0.0</spark.version>
        <scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
        <scalatest.skip>false</scalatest.skip>
        <spark.dependencyScope>provided</spark.dependencyScope>
        <encoding>UTF-8</encoding>
        <java.version>1.8</java.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <!-- the version for hybridse-native & openmldb-native
             override this to publish a variant release e.g macos variant
             checkout java/prepare_release.sh how to prepare a variant release -->
        <variant.native.version>0.4.4-hotfix1</variant.native.version>

        <plugin.violationSeverity>error</plugin.violationSeverity>
        <spotless-maven-plugin.version>2.9.0</spotless-maven-plugin.version>
        <eclipse.jdt.version>4.13.0</eclipse.jdt.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.binary.version}</artifactId>
            <version>3.0.0</version>
            <scope>test</scope>
        </dependency>
   </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <!-- those plugins are enable for all submodules -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- runs unit tests -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- scala's code coverage plugin -->
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- bundle git info into jar -->
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- deploy to sonatype -->
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- create jar with source code -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- create jar with javadoc -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- sign those jars(compiled, source, javadoc) with gpg -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- code coverage reports generator for Java projects -->
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>3.1.2</version>
                    <configuration>
                        <configLocation>google_checks.xml</configLocation>
                        <consoleOutput>false</consoleOutput>
                        <failsOnError>true</failsOnError>
                        <failOnViolation>true</failOnViolation>
                        <violationSeverity>${plugin.violationSeverity}</violationSeverity>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>8.41</version>
                        </dependency>
                    </dependencies>
                </plugin>
            <plugin>
              <groupId>org.jacoco</groupId>
              <artifactId>jacoco-maven-plugin</artifactId>
              <version>0.8.7</version>
              <executions>
                <execution>
                  <goals>
                    <goal>prepare-agent</goal>
                  </goals>
                </execution>
                <execution>
                  <id>report</id>
                  <phase>prepare-package</phase>
                  <goals>
                    <goal>report</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
                <plugin>
                    <groupId>com.diffplug.spotless</groupId>
                    <artifactId>spotless-maven-plugin</artifactId>
                    <version>${spotless-maven-plugin.version}</version>
                    <!-- spotless:check is bound to verfiy phase by default -->
                    <configuration>
                        <java>
                            <eclipse>
                                <version>${eclipse.jdt.version}</version>
                                <file>eclipse-formatter.xml</file> <!-- optional -->
                            </eclipse>
                            <!-- <licenseHeader> <!&#45;&#45; specify either content or file, but not both &#45;&#45;> -->
                            <!--     <content>/* Copyright $YEAR 4Paradigm */</content>  <!&#45;&#45; or <file>${basedir}/license&#45;header</file> &#45;&#45;> -->
                            <!--     <delimiter> -->
                            <!--         Licensed -->
                            <!--     </delimiter>  <!&#45;&#45; content until first occurrence of the delimiter regex will be interpreted as header section &#45;&#45;> -->
                            <!-- </licenseHeader> -->
                        </java>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.7.0</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M5</version>
                    <configuration>
                      <reuseForks>false</reuseForks>
                      <forkCount>1</forkCount>
                      <argLine>@{argLine} -Xmx4G</argLine>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>2.8.1</version>
                </plugin>
                <plugin>
                    <groupId>org.scoverage</groupId>
                    <artifactId>scoverage-maven-plugin</artifactId>
                    <version>1.4.11</version>
                    <executions>
                        <execution>
                            <id>scoverage-report</id>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>report</goal> <!-- or integration-check -->
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.2.1</version>
                <configuration>
                    <scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
                    <scalaVersion>${scala.version}</scalaVersion>
                    <jvmArgs>
                        <jvmArg>-Xms2048m</jvmArg>
                        <jvmArg>-Xmx2048m</jvmArg>
                    </jvmArgs>
                    <args>
                        <arg>-deprecation</arg>
                        <arg>-feature</arg>
                    </args>
                </configuration>
                <executions>
                    <!-- process mixed compilation of java and scala files -->
                    <execution>
                        <id>scala-compile-first</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>add-source</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>scala-test-compile</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    <junitxml>.</junitxml>
                    <filereports>WDF TestSuite.txt</filereports>
                    <argLine>-Xmx8192m -XX:MaxPermSize=2048m -Duser.timezone=GMT+8</argLine>
                    <skipTests>${scalatest.skip}</skipTests>
                    <systemProperties>
                        <property>
                            <name>log4j.configuration</name>
                            <value>${project.basedir}/src/test/resources/log4j.properties</value>
                        </property>
                    </systemProperties>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
                <!-- For deploying in central repository -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                            <configuration>
                                <!-- <useAgent>true</useAgent> -->
                                <!-- uncomment this if want to specify gpg sign key -->
                                <!-- <keyname>${gpg.keyname}</keyname> -->

                                <passphraseServerId>gpg.passphrase</passphraseServerId>

                                <!-- <passphrase>${gpg.passphrase}</passphrase> -->
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.7</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.4.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.2.1</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9.1</version>
                    <configuration>
                      <quiet>true</quiet>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                  <groupId>pl.project13.maven</groupId>
                  <artifactId>git-commit-id-plugin</artifactId>
                  <version>2.2.4</version>
                  <executions>
                    <execution>
                      <id>get-the-git-infos</id>
                      <goals>
                        <goal>revision</goal>
                      </goals>
                      <phase>initialize</phase>
                    </execution>
                  </executions>
                  <configuration>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
                    <injectAllReactorProjects>true</injectAllReactorProjects>
                  </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.9.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.1.2</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                </reportSets>
                <configuration>
                    <configLocation>google_checks.xml</configLocation>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>4.2.2</version>
            </plugin>
        </plugins>
    </reporting>

  <distributionManagement>
    <snapshotRepository>
        <id>ossrh</id>
        <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
        <id>ossrh</id>
        <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>
</project>

