[英]how to add scala-test support to intellij
How do I install scala-test with intellij. 如何使用intellij安装scala-test。 The video on the intellij website shows them adding a library dependency with scala-test showing up on the list. intellij网站上的视频显示他们添加了一个库依赖项,scala-test显示在列表中。 I don't have that however as I'll need to install scala-test somehow first. 我没有那个,因为我需要先安装scala-test。 The quickstart on the scala website just seems to have a link to a jar file. scala网站上的快速入门似乎有一个jar文件的链接。 Do I configure the IDE in some way to point to that jar file as a global library? 我是否以某种方式配置IDE以将该jar文件指向为全局库?
No need for a global library. 不需要全球图书馆。 Intellij IDEA supports adding libraries to your project directly from Maven. Intellij IDEA支持直接从Maven向您的项目添加库。 Here's how: 这是如何做:
This brings up a search dialog which you can use to find the Maven dependency you want. 这将打开一个搜索对话框,您可以使用它来查找所需的Maven依赖项。 Try searching for "org.scalatest:scalatest" to get the list of scalatest libraries. 尝试搜索“org.scalatest:scalatest”以获取最新的库列表。
To install the latest version of ScalaTest and its dependencies in IntelliJ IDEA 2016.3.2 , you need: 要在IntelliJ IDEA 2016.3.2中安装最新版本的ScalaTest及其依赖项,您需要:
Visit http://www.scalatest.org/install (section To include ScalaTest 3.0.1 in your Maven project
) to fetch a list of reqiered libraries full names with the following structure {groupId}:{artifactId}:{version}
, eg 访问http://www.scalatest.org/install (部分To include ScalaTest 3.0.1 in your Maven project
)以获取具有以下结构{groupId}:{artifactId}:{version}
全名的列表{groupId}:{artifactId}:{version}
,例如
org.scalactic:scalactic_2.11:3.0.1
org.scalatest:scalatest_2.11:3.0.1
Make sure that libraries names contain a Scala version you use in you project, ie above libraries are compatible with Scala 2.11 and not working with the new 2.12 version . 确保库名称包含您在项目中使用的Scala版本,即上面的库与Scala 2.11兼容而不使用新的2.12版本 。
Go to File
⇒ Project Structure...
or press Ctrl + Alt + Shift + S (Windows): 转到File
⇒ Project Structure...
或按Ctrl + Alt + Shift + S (Windows):
Go to Project Settings | Modules
转到Project Settings | Modules
Project Settings | Modules
section and click on Dependencies
tab. 单击Project Settings | Modules
部分,然后单击Dependencies
选项卡。 Then click +
⇒ 2 Library...
⇒ From Maven...
: 然后单击+
⇒2Library 2 Library...
⇒ From Maven...
:
Type in the full library name to install, then click Search
button (or press Shift + Enter ), select the library you need and click OK
: 输入要安装的完整库名称,然后单击“ Search
按钮(或按Shift + Enter ),选择所需的库,然后单击“ OK
:
Repeat steps 3 and 4 until all dependencies are installed. 重复步骤3和4,直到安装所有依赖项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.