<?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>

    <groupId>cn.guruguru</groupId>
    <artifactId>datalink</artifactId>
    <version>0.0.2</version>
	<packaging>jar</packaging>

	<name>DataLink</name>
	<description>A data integration framework based on Spark and Flink</description>
	<url>https://github.com/jinsyin/datalink</url>

	<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>JinsYin</name>
			<email>jinsyin@163.com</email>
		</developer>
	</developers>

	<scm>
		<url>https://github.com/jinsyin/datalink</url>
		<connection>scm:git:git://github.com/jinsyin/datalink.git</connection>
		<developerConnection>scm:git:ssh://github.com:jinsyin/datalink.git</developerConnection>
	</scm>

	<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>
	</distributionManagement>

    <properties>
        <java.version>8</java.version>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <inlong.version>1.6.0</inlong.version>
        <lombok.version>1.18.2</lombok.version>
		<scala.version>2.12.10</scala.version>
        <flink.version>1.15.4</flink.version>
		<spark.version>3.1.1</spark.version>
        <junit.version>4.12</junit.version>
        <jsqlparser.version>4.6</jsqlparser.version>
        <calcite.version>1.27.0</calcite.version>
    </properties>

    <dependencies>
        <!-- Lombok -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.2</version>
            <scope>provided</scope>
        </dependency>

        <!-- InLong Sort for testing -->
        <dependency>
            <groupId>org.apache.inlong</groupId>
            <artifactId>sort-common</artifactId>
            <version>${inlong.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.inlong</groupId>
            <artifactId>sort-core</artifactId>
            <version>${inlong.version}</version>
            <scope>provided</scope>
        </dependency>

		<!-- Spark and Flink use the same scala version -->
		<dependency>
			<groupId>org.scala-lang</groupId>
			<artifactId>scala-library</artifactId>
			<version>${scala.version}</version>
		</dependency>

		<!-- Flink Table Common for using its types -->
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-table-common</artifactId>
            <version>${flink.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.scala-lang</groupId>
					<artifactId>scala-library</artifactId>
				</exclusion>
			</exclusions>
        </dependency>

		<!-- Spark Catalyst for using its types -->
		<dependency>
			<groupId>org.apache.spark</groupId>
			<artifactId>spark-catalyst_2.12</artifactId>
			<version>${spark.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.scala-lang</groupId>
					<artifactId>scala-library</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- Test dependency -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- SQL Parser for Flink -->
        <dependency>
            <groupId>com.github.jsqlparser</groupId>
            <artifactId>jsqlparser</artifactId>
            <version>${jsqlparser.version}</version>
        </dependency>

        <!-- SQL Parser for Spark -->
        <dependency>
            <groupId>org.apache.calcite</groupId>
            <artifactId>calcite-core</artifactId>
            <version>${calcite.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.calcite</groupId>
            <artifactId>calcite-server</artifactId>
            <version>${calcite.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Maven Compiler Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <compilerArgument>-parameters</compilerArgument>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <!-- Maven JavaDoc Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
			<!-- Maven Source Plugin -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.3.0</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- Central Publishing Maven Plugin for publishing components in Maven Central -->
			<!-- https://central.sonatype.org/publish/publish-portal-maven/ -->
			<plugin>
				<groupId>org.sonatype.central</groupId>
				<artifactId>central-publishing-maven-plugin</artifactId>
				<version>0.4.0</version>
				<extensions>true</extensions>
				<configuration>
					<publishingServerId>central</publishingServerId> <!-- The ID of the server in settings.xml -->
					<tokenAuth>true</tokenAuth> <!-- use token authentication in settings.xml -->
					<checksums>required</checksums> <!-- MD5 and SHA1 checksums  -->
				</configuration>
			</plugin>
			<!-- Maven GPG Plugin -->
			<!-- https://central.sonatype.org/publish/requirements/gpg/ -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>3.2.2</version>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
        </plugins>
    </build>

</project>
