问题
I'm migrating a project from Apache Maven to sbt.
My project has lots of dependencies (over 200), and sometimes, a class can be duplicated that can lead to strange effects.
In Maven I've been using maven-duplicate-finder-plugin for detecting such cases.
The only solution I can see is to generate a big jar with sbt-assembly plugin, and configure to complain about duplicated classes. I haven't tried it yet.
How can I do it with SBT?
References:
- List of SBT plugins
- SBT assembly plugin documentation.
回答1:
I don't know of a plugin which finds duplicate classes, but there is sbt-dependency-graph which will list out all dependencies including transitive ones. This way you can analyze version conflicts and such. Hopefully this will help with your use case.
来源:https://stackoverflow.com/questions/27635346/how-can-i-find-duplicate-classes-amongst-dependencies-with-sbt