'PlantUml Graphviz generates 2 duplicate diagrams

I have this markdown code that is going to be generated into an html file using plantuml and graphviz.

 @image html Module23Static.png TC3
 @startuml{Module23Static.png}
   caption Module Dependencies and Interfaces of Module 23
   skinparam componentStyle uml2
     package "SW_Component"{
       [Module 1\n--\n provided interfaces:\n func1\n data1\n--\n required interfaces:\n Module2\n Module3] as M1
       [Module 2\n--\n provided interfaces:\n func2\n--\n required interfaces:\n interface_3\n Module4] as M2
       [Module 4\n--\n provided interfaces:\n func7\n func8] as M4
       M1 ..> M2 : use
       M2 ..> M4 : use
     }
 @enduml

This block of code will generate the same diagram twice, one after the other. I want it to create the diagram once only.

If I remove the line "@image html Module23Static.png TC3", it gives me a "Dot Executable: File does not exist Cannot find Graphviz..." error. I already have Graphviz 2.50 and Doxygen 1.8.14 installed, and I have also set the GRAPHVIZ_DOT variable.

I am running on Windows, and using a batch file to generate the doxygen with plantuml and graphviz installed.

What am I missing here? Anyone encountered the same issue before?



Solution 1:[1]

Doxygen will, based on the @startuml ... @enduml create an image with the name Module23Static.png and add it to the output. Beforehand you also use @image html Module23Static.png TC3 and this also adds the same image, hence you get twice the image.

So you can remove the image html Module23Static.png TC3

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 albert