Reputation: 14414
I am using ScalaTest 2.2.1
in my project but some dependency I use brings in ScalaTest 1.9.2
. In SBT, this causes no proble. It compiles and runs all tests.
In IntelliJ, the test show the in
with "cannot resolve symbol in" although it still compiles. Hoever the test runner dies with"
An exception or error caused a run to abort: org.scalatest.FlatSpecLike$$anonfun$1$$anon$2 cannot be cast to org.scalatest.words.ResultOfStringPassedToVerb
If I manually remove ScalaTest 1.9.2
from the External Libraries, all works again, but of course the next time the project refreshes, I'm back to square one.
Is there some configuration for conflict resolution in IntelliJ that I need to set or is this an IntelliJ bug?
Upvotes: 0
Views: 1711
Reputation: 14414
SBT, internally, defaults its conflictManager
to latestRevision
. However, when intellij runs its own version of the SBT build, it doesn't seem to set the same default. What seems to work is to explicitly set the conflict manager in the SBT config:
conflictManager := ConflictManager.latestRevision
Intellij will still color code certain aspects of the test in my scenario as "Cannot resolve symbol", but neither compile, not test run are failing anymore
Upvotes: 3