# plantuml **Repository Path**: beyond-prototype/plantuml ## Basic Information - **Project Name**: plantuml - **Description**: plantuml demo - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-07-06 - **Last Updated**: 2025-10-21 ## Categories & Tags **Categories**: eda **Tags**: None ## README # PlantUML Rich PlantUML support for Visual Studio Code. ## 1. Install PlantUML plugin Search in marketplace and Install **PlantUML** https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml ![plugin](vsc-marketplace.png) ## 2. Local Render To render plant uml source code locally as UML diagram, it's necessary to have following installed: **Java** : Platform for PlantUML running. **Graphviz** : PlantUML requires it to calculate positions in diagram. Notes: Graphviz is optional if you only need sequence diagrams and activity (beta) diagrams. #### 2.1 Macports The [MacPorts Project](https://www.macports.org/index.php) is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac operating system. We will use macports to install Graphviz, so we need to install it first. The easiest way to install MacPorts on a Mac is by downloading the pkg or dmg. Please refer to **macOS Package (.pkg) Installer** in the installation guideline [https://www.macports.org/install.php](https://www.macports.org/install.php) After macports is installed successfully, you can use the command below to check macports help. ``` > man port ``` You can use the command below to upgrade macports. ``` > sudo port -v selfupdate ``` #### 2.2 Graphviz [Graphviz](https://www.graphviz.org/#what-is-graphviz) is open source graph visualization software. Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. It has important applications in networking, bioinformatics, software engineering, database and web design, machine learning, and in visual interfaces for other technical domains. Once macports is installed successfully, use the command below to install graphviz. ``` > sudo port install graphviz ``` ## 3. Create UML diagram Create a file **class.puml** for a sample class diagram ``` @startuml interface Flying { {abstract} flying(): void } abstract class Animal { - name: String + getName(): String } class Bird Bird --|> Animal Bird ..|> Flying @enduml ``` Right click on **class.puml** editor and click **Preview Current Diagram** on the popup menu or use shortcut **option + D** (Mac) to preview the UML diagram. ![vscode-plantuml-preview.png](vscode-plantuml-preview.png) ## 4. Generate UML diagram https://plantuml.com/starting #### 4.1 Download plantuml.jar http://sourceforge.net/projects/plantuml/files/plantuml.jar/download #### 4.2 Command to generate diagram ``` > java -jar plantuml.jar class.puml ``` ## 5. Plantuml Server #### 5.1 Clone the source codes from github ``` > git clone https://github.com/plantuml/plantuml-server.git > cd plantuml-server > git remote show origin * remote origin Fetch URL: https://github.com/plantuml/plantuml-server.git Push URL: https://github.com/plantuml/plantuml-server.git HEAD branch: master ``` #### 5.2 Run Plantuml Server Check Environments - jre/jdk 11 or above - apache maven 3.0.2 or above ``` > mvn -v Apache Maven 3.8.4 Java version: 11.0.13, vendor: Oracle Corporation ``` Run Plantuml Server on default port 8080 ``` > mvn jetty:run ``` Or use Docker to run the server ```bash docker pull plantuml/plantuml-server:jetty docker run -d -p 8080:8080 -e BASE_URL=plantuml --name plantuml-server plantuml/plantuml-server:jetty ``` #### 5.3 Access Plantuml Server on browser http://localhost:8080/plantuml ![Plantuml-Server](Plantuml-Server.png)