I need to add .jar as an unmanaged dependency to a Scala sbt project (this is java-stellar-sdk ). Everything works well until I run sbt test. It seems that the version of Mockito in the .jar file contradicts the one I use in the project. I get a lot of errors that some Mockito matches were not found, but everything works fine without .jar in the lib folder.
Is there a way to tell sbt that it should ignore some libraries in .jar or that managed dependencies take precedence? I also found this related question , but obviously this did not help me.
An alternative workaround will also help. Is it possible to isolate libraries in a bank in such a way that I can just make a visible view from the outside?
Update: .jar contains Mockito 2, but my project uses Mockito 1, so this is a very simple and obvious conflict that I can solve by updating Mockito 2 (which I tried and it works). However, the question remains: is there another reasonable way to isolate the Mockito dependency in .jar, so as not to interfere with my project if I cannot or do not want to resolve the purchase of the conflict, moving to a newer version of the library under discussion. Perhaps change .jar to rename conflicting packages? I dont know. Something like that.
I know that this is a very general question, which was probably discussed somewhere deep down. However, I did not find anything that really satisfied me. Of course, links to relevant discussions of the topic are also welcome.
lex82 source
share