Problem: I need to combine using of many artifacts in my maven project:
hbase, hadoop-client, akka, spray, netflix-curator, spark. All these
artifacts depend on different versions of other artifacts: zookeper-client,
protobuf, jetty, etc. I've spent 3 days just to write all excludes
correctly to archive version compatibility. So now I've got pretty
consistent configuration. I want to create a framework to help my
colleagues, who work on a similar stack, to use results of my work and
don't spend 3 days on writing excludes.

    I'm aware of maven-enforcer-plugin, which doesn't allow you to use the
same artifacts with a different version. It helps, but it's not enough.

I would love to hear about solutions you might suggest. Here's my vision: I
create a parent pom with dependency management only. In this dependency
management I write all the excludes and make the artifacts compatible. Then
someone can use this pom as a parent and just write dependencies. But there
is a problem. We excluded zookeeper from netflix-curator and hadoop, but
not from hbase. So when we use all 3 artifacts we receive zookeeper from
hbase, but when use only netflix-curator and hadoop we can lost needed
artifacts. And we would recognize it only when in Runtime we receive
"ClassNotFoundException". That's why I want to write an additional plugin
for this case. This plugin would check: if you have dependency on some
artifact, you should depend on artifacts, which were excluded from that
artifact. If you lost some artifact, you need to add it or configure an
exception.

What do you think about such solution?


-- 



*Sincerely yoursEgor PakhomovScala Developer, Yandex*

Reply via email to