步驟
克隆
git clone https://github.com/confluentinc/kafka-connect-elasticsearch.git
導入到idea中
在idea通過File->New->Project From Existing Sources即可將源碼導入到idea中肠缔。
編譯及問題
在項目根目錄執(zhí)行
mvn compile
此時會出現(xiàn)依賴的
<parent>
<groupId>io.confluent</groupId>
<artifactId>common</artifactId>
<version>${version}</version>
</parent>
無法識別的問題夏跷,通過查閱文檔哼转,解決辦法是:
- 下載并安裝common依賴
git clone https://github.com/confluentinc/common.git
mvn install
- 下載并安裝kafka依賴
git clone https://github.com/apache/kafka.git
./gradlew installAll
這里的主要操作是在本地安裝kafka-connect-elasticsearch的依賴,有時候因為版本問題可能無法找到相應的依賴槽华,此時壹蔓,你需要將common或者kafka工程reset到所需要的版本
編譯成功
重新到根目錄執(zhí)行
mvn install