Michal Vician
Michal Vician

Reputation: 2545

Is there a tool to generate Spring application context dependency diagram/graph?

Is there a tool to generate diagram/graph of Spring application context?

The tool should take into consideration also annotation driven configuration (like @Autowired).

The tool may generate the dependency diagram by 'dumping' BeanDefinitions in runtime. I.e. I don't require the tool to make static code analysis.

Upvotes: 38

Views: 23954

Answers (4)

arServ
arServ

Reputation: 21

There's this thing called AppMap.io, which traces application runtime and visualizes it.

Upvotes: 0

kc2001
kc2001

Reputation: 5247

IntelliJ IDEA's Ultimate Edition can generate a Spring dependency graph. Basically, right click on the file name and select Diagrams -> Show Diagram. This web page provides the details.

Upvotes: 16

Sebastian J.
Sebastian J.

Reputation: 762

Another tool you may want to look into: https://github.com/aigor/spring-beans-visualized

It purely works on a running ApplicationContext and does not do a static analysis. It does need Spring-Boot though to work.

Upvotes: 1

Stefan
Stefan

Reputation: 12453

The Spring IDE + Eclipse or the Spring Source Tool Suite can generate simple graphs of your dependencies.

To do that open the view called "Spring Explorer" and choose your project. Then click right mouse -> Properties and combine some/all of your context files into a "Config Set". After saving you can right click on it in the Spring Explorer and choose "Open dependency graph".

The graph is static and quite untidy, but this might help.

Upvotes: 16

Related Questions