0

What I'm trying to do is very similar to this, I just wanted to know if the answer is up to date since this problem was answered 4 years ago.

So, I have 2 maven project let's say A and B, project A depends on Spring 3 project B depends on Spring 5, I want to add some project B functionalities to project A so I have added B as a dependency to project A, the problem is that now project A have 2 conflicting spring versions spring 3 and 5 and I can't use spring 5 since it's not backward-compatible.

I'm using maven for dependency management, I don't know if the solution provided in this post is working I haven't tried it yet (it seems to be a long procedure) I want the easiest way to do it;

please help.

Toufik ID
  • 50
  • 6

1 Answers1

0

This has not changed. You cannot have multiple versions of the same class in one classloader. So you still would need classloader isolation to get this to work.

A (more or less) new solution would be to separate your application parts into micro services and call each other using some wire protocol like REST.

Michael Wyraz
  • 3,638
  • 1
  • 27
  • 25
  • In my case the two apps have to be in the same project so the second option is not possible, is there any clean way to implement classloader isolation (Maven plugin, Java lib ...) ? – Toufik ID Apr 19 '19 at 06:35