I have two libraries that both follow the same names for importing, but one has more functionality than the other. How do I make scala choose the right library to use when importing? Currently, it’s choosing the one that I don’t want which has less functionality.
I have similar code in java and it’s able to grab the correct library when I import it there, just seem to have an issue with scala.
Example:
Library 1 import (Less functionality): (package).Mail
Library 2 import (More functionality): (same package name).Mail
Note: I am using maven as my dependency manager and I can’t get rid of the library I don’t want as a lot of the code currently depends on it. I also can’t change it in any way as the code is not managed by our team.
With the autocomplete feature in IntelliJ I see 2 options with the same name when filling in the import. I’ve tried clicking on both options, but they both link back to the one I don’t want.
pom.xml
?ClassLoader
would not allow 2 classes of the same name in the same package. No matter if it's Java, Scala, Groovy, Clojure etc.