Struts 2 javassist conflict

291 views Asked by At

I m using a legacy project use struts 2.3 with javassist 3.11.0-Ga.

I want to add mockito with powermock in it but powermock need javassist 3.18.1-GA.

So when i run unit test, sometimes i got classFormatError. I find that problem is caused by javassist, i try tonre run my test with -verbose:class and effectively, i see that powermock class use javassist 3.11 instead of 3.18.

I can t upgrade struts2.3 that use javassist 3.11:( and i want to use the last version of powermock/mockito so how does it possible to force eclipse to use javassist 3.18 in test mode only?

Thanks a lot.

1

There are 1 answers

0
Amaury Fages On

You can't exclude javassist from Struts. Web app doesn't even start with exclude. The only way to do it properly and this is a pain sometimes, is to get the right lib versions for EVERY dependency you have.

Something that is often heavily ignored by project leader, upgrade regularly.