Looking for a Tool to Analyze Spring Projects and Generate Dependency Maps
Asked by
faint signal
I'm trying to figure out if there's a tool that can statically analyze my Spring project to create a call graph or a dependency tree, starting from my controller methods. My goal is to understand the internal workings of each endpoint and visualize the class hierarchy involved. I attempted to use Spring Actuator, but since I can't run the application, that doesn't work for me. It needs to function statically and ideally should be compatible with VSCode or usable from the command line. Any suggestions would be greatly appreciated!
Answers
If you're using an IDE, it should work fine for a monolithic application. But for microservices, it's likely that the IDE won't be able to manage the complexity as effectively.
Reply to this answer
If you have tests that run your endpoints, consider using VisualVM to profile your application during those tests. Also, IntelliJ has a flow analysis feature that might help you track data flow more effectively.
Reply to this answer
I think Digma could provide the analysis you need. Give it a try!
Reply to this answer
IntelliJ can do this really well! Just click on the method name and press Ctrl + Alt + H, and it'll show you the call graph. It works for any Java codebase and even allows you to navigate in both directions, which is pretty sweet.
pecan shell: Is that call graph feature a plugin or built-in?
~2nd amendment note: It would be awesome if they added an option to export the graph!
Reply to this answer
Iโd love to see a visual representation of my app too! It could definitely help in breaking down a monolith based on database tables and understanding the structure better.
Reply to this answer
You might want to check out a profiler like YourKit. It can be useful for analyzing performance and might give you the insights you're looking for.
Reply to this answer
Add your answer
Answers are reviewed before publication.
3px_border: What do you mean by that? How does being part of a microservice architecture change the IDE's capabilities?