java - select different jar at runtime - toggling -


I was thinking that there was a way to select different versions of the same jar on the runtime. I'm hoping to avoid using Maven profiles because it will be a build-time selection.

We say that there are two versions of the same jar:

greatFeature_version_A.jar

So when a class is requested, then tell version_A, the class loader will always choose the first one finds it, even if it is related to the jar.

My thinking is that an effective runtime toggle can not be achieved this way. I was thinking that anyone can experience something similar and get a recommended solution. I also hope to avoid writing a custom class loader if possible.

Many thanks!

Other related questions on the SO say a custom category loader, like any one.

You get the "rename" packages so good that the packages of Fetcher_version_ager are started. * And other start buzzer. * In this way you can use code from both jars in the same application, probably at the same time.

Comments