viernes, 17 de abril de 2015

The famous Jar Hell issue

So I reckon I'm not the first one to have this problem. I'm certainly not the one who will tell you how to solve it BUT!!!!

Here is a really small example about using the JHades tool 

Why am I posting this?
Because the example in the home page is a little bit outdated and if you search JHades for the maven dependency the first 4 links you hit get it wrong.


Maven Dependency

<dependency>
<groupId>org.jhades</groupId>
<artifactId>jhades</artifactId>
<version>1.0.4</version>
</dependency>
view raw gistfile1 hosted with ❤ by GitHub

Java Code

import org.jhades.JHades;
new JHades()
.printClassLoaderNamess()
.printClasspath()
.overlappingJarsReport()
.multipleClassVersionsReport()
.findClassByName("org.jhades.SomeServiceImpl")
view raw gistfile1.java hosted with ❤ by GitHub
You should place this in some place that you are sure it'll get run during building.
If you have issues during tests. Just create a test where the test method has this code.

Hope this helps!

No hay comentarios:

Publicar un comentario