使用maven创建scala工程

来源:互联网 发布:纵横中文网数据 编辑:程序博客网 时间:2024/04/25 08:29

其实使用maven创建scala工程和使用maven创建其他的工程是一样的操作方式, 
只是可能你的maven缺少和scala对应的Archetype。添加对应的Archetype即可。

Archetype Group Id : net.alchim31.mavenArchetype Artifact Id : scala-archetype-simpleArchetype Version : 1.6//如果下载失败在添加Repository URL试试Repository URL : http://github.com/davidB/scala-archetype-simple
  • 1
  • 2
  • 3
  • 4
  • 5

在Eclipse中新建maven项目,添加Archetype的步骤如下:

步骤一

步骤二

步骤三

之后即可向普通的maven项目一样添加自己依赖的jar文件

pom.xml 可能会报错:

Multiple annotations found at this line:
    - Plugin execution not covered by lifecycle configuration: net.alchim31.maven:scala-maven-plugin:3.2.0:testCompile (execution: 
     default, phase: test-compile)
    - Plugin execution not covered by lifecycle configuration: net.alchim31.maven:scala-maven-plugin:3.2.0:compile (execution: 
     default, phase: compile)


eclipse 菜单 Window->Preference->Maven->Errors/Warnings->Plugin execution not covered by lifecycle configuration 改成 ignore


时创建的工程还不是scala的工程,在项目名称上点击右键


原创粉丝点击