Tuesday 7 June 2016

Compatibility Issue of Spray 1.3.3 and Spec2 3.6.4


In build.sbt:
"org.specs2" %% "specs2-core" % "3.6.4" % "test",
"io.spray" %% "spray-testkit" "1.3.3",

The complile Error:

Error:scalac: bad symbolic reference. A signature in Specs2Interface.class refers to type SpecificationStructure
in package org.specs2.specification which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling Specs2Interface.class.

This is due to spray’s built-in support for specs2 is still built again specs2 2.x, not 3.x.
So you cannot use the `Specs2Interface` from spray.

Solution:
Add this line to the end of the test case.
trait Specs2RouteTest extends RouteTest with Specs2Interface

Add trait Specs2Interface to the test package.
https://gist.github.com/gmalouf/51a8722b50f6a9d30404

The problem should be solved.

Reference:
https://groups.google.com/forum/#!topic/spray-user/2T6SBp4OJeI

1 comment: