[ 
http://jira.codehaus.org/browse/MNG-3491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=132599#action_132599
 ] 

David Bernhard commented on MNG-3491:
-------------------------------------

I have written a plugin to do almost exactly this. It inspects all class files 
and warns or fails if a class is twice on the classpath. There's also an 
optional gui that shows a tree of all loaded classes and which jar they come 
from. Bytewise comparison isn't there yet but wouldn't be hard to add.

At the moment it's part of the maven utilities in our EL4J framework 
[http://el4j.sourceforge.net], as it was created to help build el4j (with 
maven, of course). I can see about releasing it without any dependencies on 
el4j core if you're interested.

> JAR hell detection
> ------------------
>
>                 Key: MNG-3491
>                 URL: http://jira.codehaus.org/browse/MNG-3491
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Dependencies
>    Affects Versions: 2.0.8
>            Reporter: Andreas Krüger
>
> When your dependency tree contains the same class twice in two different 
> versions, you are in JAR hell.
> I want Maven to detect whether that's where I am. So Maven should:
> * Open all JARs it has added to a dependency tree.
> * Check what classes are in each JAR (package name and class name).
> * If the same class is found twice in two different JARs, I want Maven to
> ** compare the two instances
> ** fail the build unless they turn out to be bytewise identical.
> All of these things should happen automatically, with every individual 
> dependency tree.
> Unless the user specifically requests. E.g., if the user knows a particular 
> set of classes is officially in the dependency tree (e.g., of a test), but 
> never actually loaded, it should be possible to accept different versions of 
> these classes (some wild card pattern).
> Regards, and thank you for providing fine software,
> Andreas

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to