I have a library A that I use in project B. Now, library A makes use of plumatics schema, as well as project B. I wonder what the best practice is here.
Include schema in library A's dependencies? Or only declare a dev-dependency on schema in library A?
If I declare a dev-dependency I require every project that depends on library A to include schema as a dependency, otherwise it will not work (I have seen that with database libs for instance). I find that a bit unlucky, because one might end up referring a lot of libs that other libraries depend on.
Or, include it as a direct dependency in library A. But then strange things may happen as I had it with schema. Library A included schema v 1.0.5 and project B schema v 1.0.3.
Now when I executed code in project B I had a weird schema error saying that something in the schema is wrong, during compile time. In the end it turned out that I have to require schema v 1.0.5 in project B too to make it work. This is even more troublesome, as I make every project, that depends on my library, depend on a transitive dependency in a specific version.
Looking at gradle for instance there is a configuration called 'providedCompile' which means it is used for compilation of the library, but not a transitive dependency if I include that library. Is there something similar for leiningen?