plantuml的安装和使用详解

349 阅读1分钟
gvm install go1.17
gmv use go1.17
go get github.com/jfeliu007/goplantuml/parser
go install github.com/jfeliu007/goplantuml/cmd/goplantuml@latest

以prometheus的client_golang为例

cd /home/dev/src
git clone  https://github.com/prometheus/client_golang.git

cd $GOPATH/bin
./goplantuml -output=/home/dev/file/all.uml.txt  -recursive /home/dev/src/client_golang/

cd /home/dev/file
# DPLANTUML_LIMIT_SIZE 是代表图片的长度,有时东西太多,那么会直接截断图片
# 如果有中文乱码 则要加参数   -charset UTF-8
# plantuml.jar 的下载链接 https://sourceforge.net/projects/plantuml/
java -DPLANTUML_LIMIT_SIZE=18192   -jar ./plantuml-jar-gplv2-1.2023.5/plantuml.jar all.uml.txt

最终会生成client_golang的UML的图片。(简书不支持显示大图片,自己生成去看吧) all.uml.png

其中一部分是: uml.png

参考文章: blog.csdn.net/qq_25821689… blog.csdn.net/sinat_32366… github.com/jfeliu007/g…