Skip to content

benjamin-sailer/classloaderhack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

classloader hack example

This project is a snipplet intended to see how a multi-module-project can use several incompatible versions of a dependency without runtime exceptions. The basic idea is to define a custom classloader that inverts the class loading hierarchy (local first instead of parent first) and use it for loading the entry classes of the "deprecated-dependency" module.

The example uses two versions of jackson that have mutually exclusive methods.

Unfortunately, up to now the URLClassLoader is not able to load classes from jars in jars, so I have to fix that before running the result would also work with the packaged (shadowed) jar.

build

$ mvn clean install

run

$ java -cp app/target/app-1.0-SNAPSHOT.jar de.bsailer.classloaderhack.app.App

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages