Is there an easy way to insert an entry into a class from a dependency?

I have a dependency whose behavior looks suspicious. I assume it has a data consumption problem: one of my class calls sets some internal variable to zero while the other call is still being processed. This throws an exception.

I want to insert logging into some classes of this dependency, to be sure that I am right.

The problem is that I cannot directly modify the sources of this dependency. I get them through Maven and can see them in my Idea, but that’s all. The only idea I have is to replace these classes with modified versions via classpath. But is there probably a better way? Can I do something like “hot redeploy” for this?

+3
source share
1 answer

You can use AOP, but I think the following alternative is much better for simply debugging your problem and controlling it all in one go.

Maven .m2 "maven install", .m2 maven maven, , .., .

0

All Articles