必定要注意設置scala的版本,設置成和spark的scala同樣的版本。html
1、命令行maven
1.在IDE的workspace下,用maven命令,新建項目,命令以下:ide
mvn archetype:generate -DarchetypeGroupId=net.alchim31.maven -DarchetypeArtifactId=scala-archetype-simple -DremoteRepositories=http://scala-tools.org/repo-releases -DgroupId=com.bigdata -DartifactId=sparkTestui
2.而後使用命令:mvn clean compilespa
3.使用scala IDE導入相關的項目。.net
2、ide直接新建命令行
1.在ide中直接新建maven項目scala
2.add archetype,以下圖unix
3、選擇的剛剛建的archetype。須要關掉新建maven項目的嚮導,從新開啓,新建的archetype才能刷新出來。htm
說明:scala-archetype-simple有2個不一樣的組織的,進maven中央倉庫能夠查詢,建議使用GroupId=net.alchim31.maven,由於這個組織出的比較新的,版本號省略就默認用最新的版本。DremoteRepositories就都是用上面的,參考下面2篇文章可知。
參考: