The most straightforward way to run
With Maven you need to use the Surefire plugin and the test command. You will need however to annotate your specification classes as JUnit tests (this requires the specs2-junit jar):
import org.specs2.runner.JUnitRunner
import org.junit.runner.RunWith
@RunWith(classOf[JUnitRunner])
class MySpecification extends org.specs2.Specification { def is = s2"""
Define your specification as usual here
"""
}
With Gradle you need to use the same RunWith annotation and the test task. You can also follow the instructions in this blog post and create a task that will leverage the