PlantUML stands as a robust tool utilized to craft UML diagrams through a straightforward and easily interpretable text description. However, it is pivotal to note that it does not restrict the creation of inconsistent diagrams — such as mutual inheritance between two classes. Consequently, it functions more as a drawing tool rather than a modeling tool.
Exploring why PlantUML could be your go-to for diagram creation:
- Text-Based Creation: PlantUML operates on a text-based principle, allowing the creation of diagrams through simple, human-readable sentences. This facilitates an easy understanding and modification of your diagram structures, even without expertise in diagramming tools.
- Open-Source and Free: Being open-source and free of charge means you can utilize PlantUML without incurring licensing or subscription fees.
- Smart Layout Algorithms: The tool employs intelligent layout algorithms, ensuring a coherent and visually pleasing arrangement of your diagram’s elements, eliminating the hassle of manual alignment.
In essence, PlantUML emerges as a potent and adaptable tool, facilitating the swift and effortless creation of professional diagrams. It caters especially to individuals who favor a text-based methodology for diagram creation, offering automated assistance in managing the layout and visualization of the diagrams.
PlantUML permits the usage of themes to personalize the look of your diagrams. Not only does it offer a variety of built-in themes for quick selection, but it also empowers you to concoct your own unique themes through the definition of custom colors and styles.
- Automated Diagram Generation: PlantUML stands as a generator that autonomously creates diagrams based on your provided text. This feature not only simplifies the rapid creation and updating of diagrams but also allows you to concentrate on delineating the structure and relationships rather than the aesthetics.
Say goodbye to the tedious task of manually aligning individual elements in your diagram. PlantUML's intelligent layout algorithms shoulder the hefty task of organizing the elements in your diagram clearly and logically. This ensures that you retain your focus on illustrating the vital relationships and structures, facilitating the creation of professional diagrams effortlessly and swiftly.
- Benefit from Automatic Layout Adjustments
Differentiating it from many of its counterparts, PlantUML operates primarily as a generator, fabricating diagrams autonomously based on the input text. This not only promotes rapid and fuss-free diagram creation but also streamlines the updating process — a simple alteration in the input text reflects instantly in the diagram.
However, this convenience comes at the cost of limited control over the precise layout, a constraint when compared to tools that permit manual element positioning. Despite this, many find the efficiency and time-saving attribute of a generator outweighs this shortcoming.
For those seeking advice or solutions to common layout issues, the PlantUML community forum stands as a vibrant platform to exchange tips and procure answers to your dilemmas, enhancing your mastery over customizing your diagrams.
- Understanding PlantUML as a Generator
Links to png or svg generated by PlantUML Server are valid forever (that is as long as the server is up).
However, we do not store any diagrams on our servers.
This may sound contradictory. It is not: the whole diagram is compressed into the URL itself. When the server receives the URL, it decompresses the URL to retrieve the diagram text and generates the image. There is no need to store anything. Even if the server is down, you can retrieve the diagram using the flag
-decodeurl with the command line. Furthermore, the diagram data is stored in PNG metadata, so you can fetch it even from a downloaded image.
Occasionally we may activate HTTP traces on our server. This is mainly for performance issues (when we have some) to understand the traffic we get. Once the issue solved, we turn back off HTTP traces and we remove the logs.
Concerning sensitive content: even if we do not store the generated diagrams, please be aware that all traffic goes through HTTP, so it's easy to catch.
So you should probably install a local server on your own network if you plan to generate diagrams with sensitive information. You can do this with no Java/J2EE knowledge since there is a tiny web server included in PlantUML.jar.
PlantUML has been installed on various systems, and some users have reported minor issues when installing it.
You can have a look on this page which give advises if something is wrong.
You have more information about Graphviz about Graphviz here.
The following version have been tested, and are known to work:
Note that versions 2.39 to 2.42 do not work very well with PlantUML.
With version 2.44, under Windows, you may have to run
dot -c in a command line to finalize the installation, like in the following example:
You may have to run
dot -c with Administrator Right.
Another option is to install Win32 version of GraphViz 2.44 which does not require this post-install process.
If you compile Graphviz by yourself, you have to build it with libexpat in order to work with PlantUML.
Google Trends are somehow positive. And there are few books that mention PlantUML. So yes, it's mature.
Note that PlantUML is developed with continuous integration in mind. That means that there are new releases quite often, with (hopefully!) backward compatibility. So the file
PlantUML.jar may changed over time, while keeping the same name.
If you want to know the exact version you are using, you can type in the command line:
java -jar plantuml.jar -version
or use the following small special diagram description:
To check if a newer version is available for download, you can go to the download page.
You can also subscribe to the following rss flows:
Or you can use the command line:
java -jar plantuml.jar -version
Or use the following small special diagram description:
PlantUML limits image width and height to 4096. There is an environment variable that you can set to override this limit:
PLANTUML_LIMIT_SIZE. You have to define this variable before launching PlantUML, something like:
setenv PLANTUML_LIMIT_SIZE 8192
Another way is an option in the command line:
java -DPLANTUML_LIMIT_SIZE=8192 -jar /path/to/plantuml.jar ...
Note that if you generate very big diagrams, (for example, something like 20 000 x 10 000 pixels), you can have some memory issues. The solution is to add this parameter to the java vm : -Xmx1024m.
Characters encoding is a subtle thing... By default, PlantUML use the default charset of your platform, which may or may not be UTF-8 . If you want to know which charset you are using, you can type the following command:
java -jar plantuml.jar -help
-charset XYZ To use a specific charset (default is windows-1252)
If you want to use a different charset, for example UTF-8, you can use the
-charset flag :
java -jar plantuml.jar -charset UTF-8 ...
You can also find here information about unicode . Note that even if Java does not support B.O.M. (Byte Order Mark) in UTF-8 format file, a workaround has been put into PlantUML, so this should not be an issue.
Some Japanese users reported that they have to set the
LANG variable to
ja_JP.UTF-8 in their shell before launching PlantUML.
export LANG = ja_JP.UTF-8
Since the new architecture, it should simply work, because Java knows how to draw East Asian characters.
You can use the
-teps flag in the command line, or
format="eps" in the ANT task.
Work is in progress.
Short answer: You do have to use
@startjcckit...) when starting a diagram.
@startjcckit is useful to determine the type of diagram (uml, ditaa, jcckit...), and because you can optionally put a filename after the
@startXYZ. This also allows to have several diagrams inside the same file.
Earlier versions of PlantUML were not supporting ditaa or jcckit. When you use -pipe flag, since the diagram is generated to standard output, there could be only one diagram in the standard input. And there is no need to specify a filename. For all those reasons,
@startuml was not needed when using -pipe flag at that time.
Later, it has been decided to normalize this, and to impose
@startXYZ everywhere, even with -pipe flag, because it was confusing for users. Unfortunately, since some existing scripts were already using the fact that
@startuml is not needed in -pipe flag, it has been decided to keep this as a deprecated option, just to allow older scripts to run. We indeed do pay attention of ascending compatibility.
For newer scripts, you should not rely on this, and use
@endXYZ with the -pipe flag.
PlantUML is distributed under the GPL license.
You can print the license using the command line option:
java -jar plantuml.jar -license
Or you can use the special diagram:
You can also use:
Those versions miss few features (DITAA for example), but are 100% able to generate UML diagrams.
You can print the license of these versions using the command line option:
java -jar plantuml.jar -license
Or you can use the special diagram:
No, they are not.
Images (whatever their format : PNG, SVG...) generated by the execution of PlantUML are owned by the author of their corresponding sources code (that is, their textual description in PlantUML language).
Images generated by the execution of PlantUML are not considered as covered work. You can do whatever you want with them.
The generated images can then be used without any reference to the GPL/LGPL/ASL/EPL/MIT license. It is not even necessary to stipulate that they have been generated with PlantUML, although this will be appreciated by PlantUML team.
There is an exception : if the textual description in PlantUML language is also covered by some license (like the GPL/LGPL/ASL/EPL/MIT), then the generated images are logically covered by this license.
As long as you do not modify the Java source code and the jar file, you can integrate PlantUML.jar in your own closed source software.
The only constraint is that you have to mention somewhere in your own license or in your documentation that you are using PlantUML and that PlantUML is distributed under LGPL.
You can then even sell your software and earn money, without any other constraints (although donation will be appreciate in that case
There are no license for the PlantUML syntax itself : this means that everybody can use it.
So you can use PlantUML comments into your own code : those comments are owned by yourself, and are not considered as covered work, and are not covered by the GPL/LGPL/APL/EPL/MIT license.
Only the current implementation (that is, PlantUML program) is licensed under GPL, LGPL, ASL, EPL or MIT. On the other hand note that the documentation (examples, notices, ...) published in the PlantUML website is copyrighted. But you can still write your own documentation.
PlantUML is using Graphviz to generate some diagrams. So PlantUML is launching dot program and retrieve the information generated by dot as a SVG flow.
This message means that PlantUML is getting an empty flow from dot execution, and therefore cannot generate UML diagrams. There may be several reasons why this happens:
If you have the error message
- There is an issue with your Graphviz installation. Try a very simple diagram, with only one class for example.
- Your version of Graphviz is too old and is crashing with information provided by PlantUML. Check your version with
- Your diagram is too complex.
- There is a bug in PlantUML and/or in dot.
java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.plantuml.ugraphic.UFont, it probably means that there are no fonts installed on your server.
You can solve it by adding
fontconfig on your system:
sudo yum install fontconfig
sudo apt-get install fontconfig
You may also need to install
If you are running PlantUML on a linux server without graphical capability, you may have some error message:
Basically, this is because PlantUML needs to have access to some graphical resources (more information here).
You can turn PlantUML to headless mode, using the flag
- Can't connect to X11 window
- X11 connection rejected because of wrong authentication.
/usr/bin/java -Djava.awt.headless=true -jar /data/PlantUml/plantuml.jar ...
If you see a similar message on MacOS Ventura after running
plantuml with no arguments, this is a known issue but does not appear to indicate a problem since sub-commands (like
-gui) do work.
Under Mac OS X, if you have some error message like:
Error java.lang.UnsatisfiedLinkError / liblwawt.dylib /libosxapp.dylib
You need to follow the instructions on http://stackoverflow.com/questions/25914757/osx-yosemite-jvm-shared-library-does-not-contain-the-jni-createjavavm-symbol:
This seems to work only under Java 6, so you may define the following alias to be used in your scripts.
- Download and install the package: JavaForOSX.
- Found the file
AptanaStidio3.ini, the file by default located under the directory here:
/Applications/Aptana Studio 3/AptanaStudio3.app/Contents/MacOS
-vm argument to specify the java which will be used to lunch Aptana Studio:
alias java6="export JAVA_HOME=$(/usr/libexec/java_home -v 1.6.0)"
Depending on your configuration, you can try the flag
/usr/bin/java -Djava.awt.headless=true -jar /path/to/plantuml.jar ...
I found an issue, but I cannot provide my diagram showing the issue because my diagram contains confidential data
There is a
-cypher option with the command line that generates a
.preproc file instead of regular image file.
.preproc generated file looks like the input diagram expect that all words (except PlantUML language keywords) have been replaced by a random set of letters.
You can double check this by running several time the
-cypher option (you will get a different text each time).
You may also look at the Cypher.java class used to execute this transformation to be sure that there are no backdoor there to retrieve back your original diagram.
If there is an issue in your original diagram, the same issue is likely to also occur with the cyphered one.
Since the cyphered text is really meaningless, you can safely share it with us : there will be no way for us to guess what you are really working on.
But we will be able to reproduce the issue and fix it so that you can have your original (and confidential) diagram working.
If you have the following error message :
The currently displayed page contains invalid values
when displaying the Windows/Preferences/PlantUML, you should try to quit Eclipse and use the
-clean flag on the command line:
You can use the forum facility.
Someone will try to answer your question there.