自託管 PlantUML 服務
在 Ubuntu 安裝 openjdk
使用以下 Linxu 指令,安裝 openjdk11
| 1 | sudo apt install openjdk-11-jdk | 
下載 PlantUML 的 Jar 檔案
使用以下 Linxu 指令下載檔案
| 1 | wget -O /[執行路徑]/plantuml.jar https://github.com/plantuml/plantuml/releases/download/v1.2024.0/plantuml-1.2024.0.jar | 
建立 PlantUML 服務
使用以下 Linxu 指令建立 PlantUML 服務
| 1 | sudo nano /etc/systemd/system/plantuml.service | 
服務貼上以下內容
| 1 | [Unit] | 
啟用服務
| 1 | systemctl daemon-reload | 
設定 Visual Studio Code
安裝 PlantUML support for Visual Studio Code 套件,並在設定檔設定 plantuml.server 參數
| 1 | "plantuml.server": "https://[Domain]/plantuml" | 
建立 .puml 為附檔名的檔案,並加入以下代碼,按下 Alt + D 生成圖檔
| 1 | @startuml | 
📜 參考資料