1、下载一个maven-scala-plugin插件,本次下载为maven-scala-plugin-2.15.2.jar包,放入scala-SDK-4.0.0-vfinal-2.11-win32.win32.x86_64\eclipse\plugins路径下,然后重启eclipse
2、在项目的pom.xml中增加以下代码:
<plugin> <groupId>org.scala-tools</groupId> <artifactId>maven-scala-plugin</artifactId> <version>2.15.2</version> <executions> <execution> <id>scala-test-compile</id> <phase>test-compile</phase> <goals> <goal>testCompile</goal> </goals> </execution> </executions> </plugin>
导入即可