0

I am using a library, and one of the strings points to an API endpoint that is being shut down soon. I have been able to successfully go into the shaded jar, change the string value, and successfully run the application.

I cannot use reflection because this is being imported into a bigger system which reflection could cause some unpredictable insanity.

Is it possible to have Maven automatically change the value of the string when compiling this jar?

Jack Cole
  • 1,528
  • 2
  • 19
  • 41
  • "this is being imported into a bigger system which reflection could cause some unpredictable insanity" This is exactly what integration testing is for. If you make this change in the build process, rather than fixing it in code, you are decreasing the maintainability of your code and really just creating a band-aid solution. – Scuba Steve Jan 08 '20 at 22:56
  • have a look at https://stackoverflow.com/questions/1258562/rewriting-method-calls-within-compiled-java-classes – Robert Scholte Jan 08 '20 at 23:07
  • You don't have source code for the other library? – J Fabian Meier Jan 09 '20 at 08:52

0 Answers0