SBT: reorder dependencies in classpath

I am currently experiencing a problem with Specs2 + SBT, where my tests always fail through the command line due to the order of dependencies in the classpath. Specs2 requires Mockito jars to come after Specs2 jars, so that Mockito classes can be redefined to fix problems using the scala method parameters by name (see this problem for more information: https://github.com/etorreborre/specs2/ issues / 428 ).

In IntelliJ, I can order my dependencies through a window Project Structure/Modules/Dependenciesthat captures my tests when running inside IntelliJ, however I did not find a solution to fix this problem when running my tests on the command line through sbt test.

Does anyone know if it is possible to change the order of class relations for SBT using the settings in build.sbt(or similar)?

+4
source share
1 answer

As far as I know, you need to make sure what specs2-mockis in front of mockitothe setup libraryDependencies.

+5
source

Source: https://habr.com/ru/post/1613577/


All Articles