I have a Java service that relies on a dependency jar that I have modified. Within the dependency I have updated 2 different sections of code for unrelated functionality. I have updated the version of the jar and am including its use within the service via Maven.
Within the service, when I run the code locally via IntelliJ that calls the dependency functionality I get:
- The expected, new behavior for one of the code changes.
- Unexpected, previous behavior for the other code change. In this case, I have modified the value of a string that is being set when the code is invoked but the result is how the string was set in the old code.
- The previous version:
Collections.sort(errorRecords);
fe.setErrorMessage("Failed records - " + errorRecords);
where errorRecords is a List<Integer>
- The new version:
fe.setErrorMessage("Failed record(s) - please see documentation for remediation steps.");
For troubleshooting I have done the following:
- Deleted all previous versions of the jar from the Maven m2 repo
- Performed
mvn clean installon my service - Verified that after the
mvncall that the only version of the jar in the repo is the new one - Invalidated IntelliJ cache - I am using version 2025.2.5 Ultimate
- Opened the packaged, new jar from the m2 repository to view the .class file, and confirmed my new code is present.
- Validated that the version of the jar being used by IntelliJ (in the External Libraries section) is the new version
- Attempted to view the code within IntelliJ. Unfortunately the method where my new code is cannot be decompiled by the Fern Flower decompiler in IntelliJ, so I cannot confirm the new code is present via stepping through the code via debugger. All I see there is
// $FF: Couldn't be decompiledmessage. This is present when using older versions of the jar as well. - Rebooted as a last resort. This is running on macOS 15.7.2. As expected, that didn't fix anything.
I've run out of ideas of where to look next. Any thoughts?
-modor something like that. That way you can uniquely identify it by just looking at the jar name that is used. Just use the modified jar file and install it with the modified version into your local m2 repo: stackoverflow.com/a/4955695/150978