How do I install scala-test with intellij. The video on the intellij website shows them adding a library dependency with scala-test showing up on the list. I don't have that however as I'll need to install scala-test somehow first. The quickstart on the scala website just seems to have a link to a jar file. Do I configure the IDE in some way to point to that jar file as a global library?
2 Answers
No need for a global library. Intellij IDEA supports adding libraries to your project directly from Maven. Here's how:
- Go to File -> Project Structure
- Select the Dependencies tab
- Click the + sign at the bottom to create a new library
- Choose "New Library" and seleect "From Maven" to add a new library from the public Maven repository
This brings up a search dialog which you can use to find the Maven dependency you want. Try searching for "org.scalatest:scalatest" to get the list of scalatest libraries.
- 729
- 5
- 6
-
Thanks for the instructions. However, could not download successfully from "org.scalatest:scalatest". Used "org.scala-tools.testing:scalatest" which worked. – arcseldon May 22 '14 at 02:16
-
1As of now, using "org.scalatest:scalatest_2.11" gets you access to the latest version (3.0.1). I derived this from the groupId and artifactId in the Maven install instructions at http://www.scalatest.org/install. – Franz Amador Dec 06 '16 at 04:21
To install the latest version of ScalaTest and its dependencies in IntelliJ IDEA 2016.3.2, you need:
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}, e.g.org.scalactic:scalactic_2.11:3.0.1org.scalatest:scalatest_2.11:3.0.1Make sure that libraries names contain a Scala version you use in you project, i.e. above libraries are compatible with Scala 2.11 and not working with the new 2.12 version.
Go to
File⇒Project Structure...or press Ctrl+Alt+Shift+S (Windows):

Go to
Project Settings | Modulessection and click onDependenciestab. Then click+⇒2 Library...⇒From Maven...:

Type in the full library name to install, then click
Searchbutton (or press Shift+Enter), select the library you need and clickOK:

Repeat steps 3 and 4 until all dependencies are installed.
- 3,228
- 2
- 34
- 31