clojure-android / lein-droid

A Leiningen plugin for building Clojure/Android projects
Eclipse Public License 1.0
645 stars 56 forks source link

conflicts with same artifact name in different group #149

Open dehubbed opened 8 years ago

dehubbed commented 8 years ago

I'm trying to build an app that contains spongycastle and zxing. I have spongycastle in my dependencies first, and then as soon as I add zxing classes from spongycastle are not found anymore. They both have a maven artifact with the artifactId "core", but different groupIds of course, hence think there is a conflict.

I changed the artifactId of zxing from "core" to "zxcore" and now it works. So it is definitely the artifactId that's the problem.

bendlas commented 8 years ago

I spent some 3 hours, blaming everything from clojure to leiningen, until I independently arrived at this ticket. Here is a clear demonstration of the issue: https://github.com/bendlas/lein-resolution-failure

thanks to @noisesmith for helping to narrow this down

bendlas commented 8 years ago

Here https://github.com/clojure-android/lein-droid/blob/4a2738b1ca01b6315530fcb63629e78fac6d9b18/src/leiningen/droid/classpath.clj#L22 we need a more intelligent grouping function. Just consdering artefacts with the same name to be equal is clearly insufficient. Maybe there should be a user-configurable replacement map that defines groups whose artefacts are "interchangeable".

alexander-yakushev commented 8 years ago

This was done this way so that one can easily replace some Android-incompatible dependency with a customly built one.

I'll have to think about it. Perhaps additional parameter is necessary to state which dependencies should override others.

bendlas commented 8 years ago

Maybe a simple additional artefact paramter would do the trick. Something like [custom/clojure "1.8.0" :supersedes org.clojure/clojure]