Wait the light to fall

添加第三方 pom 仓库

焉知非鱼

Apache HBase Connector 这个 Hbase 连接器可以使用 Spark 读写 Hbase。但是 github 上没有说明怎么把它添加到 pom 文件中。

Google 了一下, 在 Maven 仓库 有这个依赖:

<!-- https://mvnrepository.com/artifact/com.hortonworks/shc-core -->
<dependency>
    <groupId>com.hortonworks</groupId>
    <artifactId>shc-core</artifactId>
    <version>1.1.1-2.1-s_2.11</version>
</dependency>

添加到 pom 文件里面发现还不行, 报红。说明找不到依赖!注意到下面还有行小字:

Note: this artifact it located at Hortonworks  repository

点击 hortonworks 看下右边的 Indexed Repositories , 其中每一行对应着仓库配置中的一个 id: Hortonworks, 这个 ID 在下面的仓库配置中就对应 <id>

这样的 jar 包在标准仓库里面没有,需要你在 pom 文件里面添加上仓库地址:

<repository>
    <id>hortonworks</id>
    <name>Hortonworks Repository</name>
    <url>http://repo.hortonworks.com/content/repositories/releases/</url>
</repository>