PlantUML Macro

Version 40.1 by Thomas Mortagne on 2021/03/17 18:32

cogDraw UML or DITAA diagrams using PlantUML
Developed by

Maxime Sinclair

1 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager


This macro permits to easily add UML (or DITAA) diagrams inside a wiki page. The diagram is defined as a simple text using a special syntax. This text is automatically interpreted to produce an image of the diagram.

This macro use PlantUML, an open-source tool, as the rendering engine.


content here...

For more detail see the description of the PlantUML language.


It works out of the box with all the different kinds of diagrams, using the PlantUML server available on the internet. You can also configure the macro to use your own PlantUML server that you can install on the web container used by your XWiki installation (for example). Once installed, internet access is not necessary. Another option is to leave the PlantUML server field empty, in which case the macro will use PlantUML in embedded mode (you'll then need to have GraphViz installed to generate all diagrams except for the Sequence one).

The PlantUML server configuration is done on the XWiki.PlantUMLMacro page.


Use Case Diagram

:Customer: -> (Withdraw)
note right of (Withdraw) : This is an example.



Class Diagram

hide empty members
hide empty methods

package "Classic Collections" #DDDDDD {
  Object <|-- ArrayList

package net.sourceforge.plantuml
class Demo1 {
  -Number Identifier
  +String Name
  Object <|-- Demo1
  Demo1 *- Demo2
end package



Ditaa Diagram

 Web Browser         JEE Server
 /--------\         +---------+     Database
 +--------+         |c789     |      +---+
 |c1FF    |<------->|  XWIKI  |<-=-->|{s}|
 |  Wiki  |  text   |         |      +---+
 |  page  |         +---------+
 |  with  |         |c789     |      +---+
 |diagrams|<------->|PlantUML |<-=-->|{o}|
 |        |  image  |   Server|      +---+
 \--------/         +---------+     Graphviz



Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Go to the page XWiki.PlantUMLMacro, you'll view a generated image proving the good installation of the macro and displaying the plantUML release used.

If you want to run your own instance of the PlantUML server, please follow the following steps:

  • Download Graphviz and install it on the web server. It's a prerequisite for PlantUML.
  • Then, you must set the GRAPHVIZ_DOT environment variable to locate the dot executable file.
  • Download the PlantUML servlet War and deploy it. You can use the web container already used by XWiki. 
  • Finally, go to the page XWiki.PlantUMLMacro and click on the "edit this URL" link to specify the address of your PlantUML server.

Release Notes


If a previous version is installed, remove it before installing this new one.

With the new include parameter, you can include the content of the specified page at the begining of the macro content. It's similar to the !include directive of PlantUML
It is very useful to locate skin directives in an unique place.


If a previous version is installed, remove it before installing this new one.

The macro works out of the box with all the different kinds of UML diagrams, using the PlantUML server available on the internet. But you can configure the macro to use your own PlantUML server.
An embedded version of PlantUML server is also available. To use it, just leave empty the Server configuration entry.

Diagrams larger than the page are now resized to avoid the horizontal scrollbar.


plantuml.jar is embedded in the macro, so is not more required to install plantuml.war.

Graphviz still required for some Diagram like Use Case diagram

Get Connected