4

I need to redefine a single class file in a spring-boot application from an external library io.external.library until they update their code. I have this working by creating a single file with the same package name and class name in my own project.

src/main/java/io/external/library/TheirFile.java

I am a bit worried that this just happens to work and in different conditions the original file might be loaded into memory.

I have seen that there may be ways to achieve this in Gradle by unzipping and repackaging the jar file. This seems to be a bit of an overkill to me though considering this is a temp solution until the third party updates their code.

What is the simplest or best practice way to achieve this?

It is a spring-boot application and my build system is Gradle.

jax
  • 37,735
  • 57
  • 182
  • 278
  • Possible duplicate of [how to retransform a class at runtime](https://stackoverflow.com/questions/18567552/how-to-retransform-a-class-at-runtime) – Sergei Voitovich Nov 20 '17 at 13:25

0 Answers0