必定要注意设置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篇文章可知。
参考: