http://blog.artifact-software.com/tech/?p=121
This describes how we solved the problem.
We built libraries that had groups of related libraries aggregated into a single jar where we fixed all of the version conflicts. Then developers only have to depend on a small number of jars that have the versions set the way we want.
We have jars for
Spring
CXF
Jasper Reports
JSF
Jetspeed
Tomcat and Java
Hibernate&MySQL
and so on. About 10 in total. These represent about 70Mb of code and configuration.

We have one called "shared" that picks up all the little utilities from Apache and others like logging, mail, document production, XML parsing.

The approved set is issued with the same version number so that developers know which set to use.
This makes their lives easier.

We also provide those libraries as jar files so that project jars only have their own code in them so they build quickly. Once you load the libraries into your container, you only have small files to handle each time you want to refresh your test site.

On 19/02/2014 6:55 AM, Egor Pahomov wrote:
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?




--
Ron Wheeler
President
Artifact Software Inc
email: [email protected]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to