Skip to content

Commit

Permalink
build: add modules for sql jar (#38)
Browse files Browse the repository at this point in the history
* build: add modules for sql jar files

* update docs about sql jar and snapshot

* use default module name
  • Loading branch information
whhe committed Aug 21, 2023
1 parent 5eba075 commit f83ded5
Show file tree
Hide file tree
Showing 10 changed files with 254 additions and 114 deletions.
27 changes: 25 additions & 2 deletions docs/sink/flink-connector-obkv-hbase.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ You can get the release packages at [Releases Page](https://github.com/oceanbase
</dependency>
```

If you'd rather use the latest snapshots of the upcoming major version, use our Maven snapshot repository and declare the appropriate dependency version.

```xml
<dependency>
<groupId>com.oceanbase</groupId>
<artifactId>flink-connector-obkv-hbase</artifactId>
<version>${project.version}</version>
</dependency>

<repositories>
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype Snapshot Repository</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
```

You can also manually build it from the source code.

```shell
Expand All @@ -24,9 +45,11 @@ cd flink-connector-oceanbase
mvn clean package -DskipTests
```

### Package with Dependencies
### SQL JAR

We provide a shaded jar file as `flink-sql-connector-obkv-hbase-${project.version}.jar`, you can see the [pom.xml](../../flink-connector-obkv-hbase/pom.xml) for more details.
To use this connector through Flink SQL directly, you need to download the shaded jar file named `flink-sql-connector-obkv-hbase-${project.version}.jar`:
- Release versions: https://repo1.maven.org/maven2/com/oceanbase/flink-sql-connector-obkv-hbase
- Snapshot versions: https://s01.oss.sonatype.org/content/repositories/snapshots/com/oceanbase/flink-sql-connector-obkv-hbase

### Demo

Expand Down
27 changes: 25 additions & 2 deletions docs/sink/flink-connector-obkv-hbase_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@
</dependency>
```

如果你想要使用最新的快照版本,可以通过配置 Maven 快照仓库来指定:

```xml
<dependency>
<groupId>com.oceanbase</groupId>
<artifactId>flink-connector-obkv-hbase</artifactId>
<version>${project.version}</version>
</dependency>

<repositories>
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype Snapshot Repository</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
```

您也可以通过源码构建的方式获得程序包。

```shell
Expand All @@ -24,9 +45,11 @@ cd flink-connector-oceanbase
mvn clean package -DskipTests
```

### 将依赖打包到 JAR 文件
### SQL JAR

这里我们提供了一个包含依赖的 jar 文件 `flink-sql-connector-obkv-hbase-${project.version}.jar`,详情可以查看 [pom.xml](../../flink-connector-obkv-hbase/pom.xml)
要直接通过 Flink SQL 使用此连接器,您需要下载名为`flink-sql-connector-obkv-hbase-${project.version}.jar`的包含所有依赖的 jar 文件:
- 正式版本:https://repo1.maven.org/maven2/com/oceanbase/flink-sql-connector-obkv-hbase
- 快照版本:https://s01.oss.sonatype.org/content/repositories/snapshots/com/oceanbase/flink-sql-connector-obkv-hbase

### 示例

Expand Down
27 changes: 25 additions & 2 deletions docs/sink/flink-connector-oceanbase.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ You can get the release packages at [Releases Page](https://github.com/oceanbase
</dependency>
```

If you'd rather use the latest snapshots of the upcoming major version, use our Maven snapshot repository and declare the appropriate dependency version.

```xml
<dependency>
<groupId>com.oceanbase</groupId>
<artifactId>flink-connector-oceanbase</artifactId>
<version>${project.version}</version>
</dependency>

<repositories>
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype Snapshot Repository</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
```

You can also manually build it from the source code.

```shell
Expand All @@ -24,9 +45,11 @@ cd flink-connector-oceanbase
mvn clean package -DskipTests
```

### Package with Dependencies
### SQL JAR

We provide a shaded jar file as `flink-sql-connector-oceanbase-${project.version}.jar`, you can see the [pom.xml](../../flink-connector-oceanbase/pom.xml) for more details.
To use this connector through Flink SQL directly, you need to download the shaded jar file named `flink-sql-connector-oceanbase-${project.version}.jar`:
- Release versions: https://repo1.maven.org/maven2/com/oceanbase/flink-sql-connector-oceanbase
- Snapshot versions: https://s01.oss.sonatype.org/content/repositories/snapshots/com/oceanbase/flink-sql-connector-oceanbase

### Demo

Expand Down
27 changes: 25 additions & 2 deletions docs/sink/flink-connector-oceanbase_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@
</dependency>
```

如果你想要使用最新的快照版本,可以通过配置 Maven 快照仓库来指定:

```xml
<dependency>
<groupId>com.oceanbase</groupId>
<artifactId>flink-connector-oceanbase</artifactId>
<version>${project.version}</version>
</dependency>

<repositories>
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype Snapshot Repository</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
```

您也可以通过源码构建的方式获得程序包。

```shell
Expand All @@ -24,9 +45,11 @@ cd flink-connector-oceanbase
mvn clean package -DskipTests
```

### 将依赖打包到 JAR 文件
### SQL JAR

这里我们提供了一个包含依赖的 jar 文件 `flink-sql-connector-oceanbase-${project.version}.jar`,详情可以查看 [pom.xml](../../flink-connector-oceanbase/pom.xml)
要直接通过 Flink SQL 使用此连接器,您需要下载名为`flink-sql-connector-oceanbase-${project.version}.jar`的包含所有依赖的 jar 文件:
- 正式版本:https://repo1.maven.org/maven2/com/oceanbase/flink-sql-connector-oceanbase
- 快照版本:https://s01.oss.sonatype.org/content/repositories/snapshots/com/oceanbase/flink-sql-connector-oceanbase

### 示例

Expand Down
56 changes: 0 additions & 56 deletions flink-connector-obkv-hbase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ See the Mulan PSL v2 for more details.

<artifactId>flink-connector-obkv-hbase</artifactId>
<packaging>jar</packaging>
<name>OceanBase Flink Connector : OBKV HBase</name>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
Expand Down Expand Up @@ -61,53 +54,4 @@ See the Mulan PSL v2 for more details.

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade-flink</id>
<goals>
<goal>shade</goal>
</goals>
<phase>package</phase>
<configuration>
<finalName>flink-sql-connector-obkv-hbase-${project.version}</finalName>
<artifactSet>
<includes>
<include>com.oceanbase:*</include>
<include>com.alibaba:fastjson</include>
<include>com.alipay.sofa:bolt</include>
<include>com.alipay.sofa.common:sofa-common-tools</include>
<include>com.google.guava:guava</include>
<include>commons-lang:commons-lang</include>
<include>commons-logging:commons-logging</include>
<include>org.apache.hadoop:hadoop-core</include>
<include>org.apache.hbase:hbase</include>
<include>io.netty:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>com.oceanbase.connector.flink.shaded.com.google</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.hadoop</pattern>
<shadedPattern>com.oceanbase.connector.flink.shaded.org.apache.hadoop</shadedPattern>
</relocation>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>com.oceanbase.connector.flink.shaded.io.netty</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
1 change: 0 additions & 1 deletion flink-connector-oceanbase-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ See the Mulan PSL v2 for more details.
</parent>

<artifactId>flink-connector-oceanbase-base</artifactId>
<name>OceanBase Flink Connector : Base</name>

</project>
47 changes: 0 additions & 47 deletions flink-connector-oceanbase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ See the Mulan PSL v2 for more details.

<artifactId>flink-connector-oceanbase</artifactId>
<packaging>jar</packaging>
<name>OceanBase Flink Connector : OceanBase</name>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
Expand Down Expand Up @@ -65,44 +58,4 @@ See the Mulan PSL v2 for more details.
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade-flink</id>
<goals>
<goal>shade</goal>
</goals>
<phase>package</phase>
<configuration>
<finalName>flink-sql-connector-oceanbase-${project.version}</finalName>
<artifactSet>
<includes>
<include>com.oceanbase:*</include>
<include>com.alibaba:druid</include>
<include>commons-collections:commons-collections</include>
<include>org.apache.commons:commons-lang3</include>
<include>com.google.guava:guava</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.apache.commons</pattern>
<shadedPattern>com.oceanbase.connector.flink.shaded.org.apache.commons</shadedPattern>
</relocation>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>com.oceanbase.connector.flink.shaded.com.google</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
80 changes: 80 additions & 0 deletions flink-sql-connector-obkv-hbase/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2023 OceanBase
flink-connector-oceanbase is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http:https://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
-->
<project xmlns="http:https://maven.apache.org/POM/4.0.0" xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http:https://maven.apache.org/POM/4.0.0 http:https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.oceanbase</groupId>
<artifactId>flink-connector-oceanbase-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>flink-sql-connector-obkv-hbase</artifactId>

<dependencies>
<dependency>
<groupId>com.oceanbase</groupId>
<artifactId>flink-connector-obkv-hbase</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade-flink</id>
<goals>
<goal>shade</goal>
</goals>
<phase>package</phase>
<configuration>
<artifactSet>
<includes>
<include>com.oceanbase:*</include>
<include>com.alibaba:fastjson</include>
<include>com.alipay.sofa:bolt</include>
<include>com.alipay.sofa.common:sofa-common-tools</include>
<include>com.google.guava:guava</include>
<include>commons-lang:commons-lang</include>
<include>commons-logging:commons-logging</include>
<include>org.apache.hadoop:hadoop-core</include>
<include>org.apache.hbase:hbase</include>
<include>io.netty:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>com.oceanbase.connector.flink.shaded.com.google</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.hadoop</pattern>
<shadedPattern>com.oceanbase.connector.flink.shaded.org.apache.hadoop</shadedPattern>
</relocation>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>com.oceanbase.connector.flink.shaded.io.netty</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Loading

0 comments on commit f83ded5

Please sign in to comment.