剛剛spark mllib,在maven repository網站http://mvnrepository.com/中查詢mllib后得到相關庫的最新dependence為:
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib-local_2.11</artifactId>
<version>2.1.0</version>
</dependency>
但是遇到錯誤:
Multiple markers at this line
- Failure to transfer
net.sf.opencsv:opencsv:jar:2.3
from https://repo.maven.apache.org/maven2
was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced.
Original error: Could not transfer artifact
net.sf.opencsv:opencsv:jar:2.3
from/to central (https://repo.maven.apache.org/maven2):
repo.maven.apache.org
查找后嘗試過得方法有:
方案1:認為有的庫沒有下載完整,因此刪除~/.m2/repository下所有內容——>重啟eclipse——>讓eclipse自動下載新的包;
結果:不好使,沒有解決掉;
方案2:(誤打誤撞的方法,見笑了)也認為沒有下載完整,更改其他版本的mllib庫為:
<dependency> <!-- Spark dependency --> <groupId>org.apache.spark</groupId> <artifactId>spark-mllib_2.10</artifactId> <version>1.6.1</version> <scope>provided</scope> </dependency>
然后,eclipse自動下載庫文件,等待完成(中間不要終止),然后錯誤消失。甚至更改為最新版本庫也沒有出現原來錯誤。
總結:
應該還是庫文件不完整造成的問題,但是也還不確定,希望以后可以慢慢理解其中原理。