【前提】:
1.windows 7 安裝maven-3.3.9
其中在conf/setting.xml檔案添加
D:\software\apache-maven-3.3.9\repository
2.windows 7 安裝eclipse 64位(百度下載下傳,解壓即可)
3.eclipse安裝maven插件,選擇第二種方式link
<a href="http://blog.csdn.net/lfsfxy9/article/details/9397937">http://blog.csdn.net/lfsfxy9/article/details/9397937</a>
其中 eclipse-maven3-plugin.7z 這個包可以加群258669058找我,分享給你
【flume-ng 1.7.0源碼的編譯導入eclipse】:
1.下載下傳官網的源碼(不要下載下傳GitHub上源碼,因為這時pom檔案中版本為1.8.0,編譯會有問題)
<a href="http://archive.apache.org/dist/flume/1.7.0/">http://archive.apache.org/dist/flume/1.7.0/</a>
a.下載下傳apache-flume-1.7.0-src.tar.gz
b.解壓重命名為flume-1.7.0
2.修改pom.xml (大概在621行,将自帶的repository注釋掉,添加以下的)
點選(此處)折疊或打開
<repository>
<id>maven.tempo-db.com</id>
<url>http://maven.oschina.net/service/local/repositories/sonatype-public-grid/content/</url>
</repository>
3.打開cmd,編譯
cd /d D:\[WORK]\Training\05Hadoop\Compile\flume-1.7.0
mvn compile
4.打開eclipse,單擊Window-->Perferences-->左側的Maven-->User Settings
然後設定自己的mvn的setting.xml路徑和Local Repository
(最好使用Maven3.3.x版本以上,我是3.3.9)
5.關閉eclipse的 Project-->Buid Automatically
6.關閉eclipse的Download repository index updates on startup
7.導入flume1.7.0源碼
a.File-->Import-->Maven-->Existing Maven Projects-->Next
b.選擇目錄--> Finish
8.檢查源碼,沒有抛任何錯誤
參考:
<a href="http://blog.csdn.net/derek_zhang_/article/details/20402901">http://blog.csdn.net/derek_zhang_/article/details/20402901</a>
<a href="https://my.oschina.net/qiangzigege/blog/522585">https://my.oschina.net/qiangzigege/blog/522585</a>
<a href="http://blog.csdn.net/qianshangding0708/article/details/48087911">http://blog.csdn.net/qianshangding0708/article/details/48087911</a>