Installing ScalaTest

ScalaTest and Scalactic 3.0.1 (the latest release for 2.10.0+, 2.11.0+, and 2.12.0+)

The ScalaTest 3.0.1 artifacts and Scalactic 3.0.1 artifacts are available via the Sonatype OSS Maven repository and mirrored on Maven central.


To include ScalaTest 3.0.1 in your sbt project:

1. Add these lines to your build file:

libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.1"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test"

The dependency on Scalactic, ScalaTest's sister library focused on quality through types, is recommended but not required.

2. We also recommend you also include the SuperSafe Community Edition Scala compiler plugin, which will flag errors in your ScalaTest (and Scalactic) code at compile time, by first adding this line to ~/.sbt/0.13/global.sbt:

resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"

3. Then adding the following line to project/plugins.sbt:

addSbtPlugin("com.artima.supersafe" % "sbtplugin" % "1.1.0")

You are off and running! As a next step, visit the Getting Started section of the user guide.


To include ScalaTest 3.0.1 in your Maven project:

1. Add the following dependencies to your pom.xml:

<dependency>
  <groupId>org.scalactic</groupId>
  <artifactId>scalactic_2.11</artifactId>
  <version>3.0.1</version>
</dependency>
<dependency>
  <groupId>org.scalatest</groupId>
  <artifactId>scalatest_2.11</artifactId>
  <version>3.0.1</version>
  <scope>test</scope>
</dependency>

The dependency on Scalactic, ScalaTest's sister library focused on quality through types, is recommended but not required.

2. We also recommend you also include the SuperSafe Community Edition Scala compiler plugin, which will flag errors in your ScalaTest (and Scalactic) code at compile time, by adding the following lines to your pom.xml:

<repositories>
    <repository>
        <id>artima</id>
        <name>Artima Maven Repository</name>
        <url>http://repo.artima.com/releases</url>
    </repository>
</repositories>
<plugin>
    <groupId>net.alchim31.maven</groupId>
    <artifactId>scala-maven-plugin</artifactId>
    <configuration>
        <compilerPlugins>
            <compilerPlugin>
                <groupId>com.artima.supersafe</groupId>
                <artifactId>supersafe_2.11.7</artifactId>
                <version>1.1.0-RC7</version>
            </compilerPlugin>
        </compilerPlugins>
    </configuration>
    <executions>
        ...
    </executions>
</plugin>

Note: You need to use the exact Scala version in the artifactId, because compiler plugin depends on compiler API that's not binary compatible between Scala minor releases.

You are off and running! As a next step, visit the Getting Started section of the user guide.


If you don't have it already, you'll also need Scala. You can use any 2.10 or 2.11 release, which you can get from here:


Older Releases of ScalaTest and Scalactic

For information on older releases, please visit the Older Releases page.

ScalaTest is brought to you by Bill Venners and Artima.
ScalaTest is free, open-source software released under the Apache 2.0 license.

If your company loves ScalaTest, please consider sponsoring the project.

Copyright © 2009-2016 Artima, Inc. All Rights Reserved.

artima