2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Mac + Atom + PlantUMLの環境構築

2
Last updated at Posted at 2021-01-27

MacでPlantUMLを使いたくなったので、環境構築をします!

PlantUMLとは?

テキストベースでUMLを描けるツールです。
例えば、ユースケース図を描きたい場合は、こんな感じになります。
テキストファイルの拡張子は「pu」です。

ユースケース図.pu
@startuml
left to right direction
skinparam packageStyle rectangle
actor 一般ユーザー
actor 管理者
rectangle 勤怠システム {
  一般ユーザー -- (勤怠入力参照)
  (勤怠入力参照) -- 管理者
  (ユーザー情報更新参照) -- 管理者
  (勤怠一括エクセル出力) -- 管理者
}
@enduml

ユースケース図
image.png

環境

image.png

インストール項目

・Java
・Atom
・graphviz
・plantuml
・Atomパッケージ(plantuml-preview,language-plantuml)

JavaとAtomのインストール

ご自由にお願いします。

graphvizとplantumlのインストール

brew install graphviz
brew install plantuml

Atomパッケージのインストールと設定

Atom→Preferencesを選択。
image.png
Settings→Installを選択。
image.png
plantuml-preview、language-plantumlでそれぞれ検索し、インストールする。
image.png
image.png
puファイルを開き、Packages→PlantUML Preview→Toggleでプレビューを表示する。
image.png
「plantuml.jar is not a file.」のエラーが出ので、「Open Package Settings」を選択。
image.png
ターミナルで以下のplantuml.jarの場所「/usr/local/Cellar/plantuml/1.2021.0/libexec/plantuml.jar」をコピーする

ターミナル
$ which plantuml
/usr/local/bin/plantuml
$ cat /usr/local/bin/plantuml
# !/bin/bash
if [[ "$*" != *"-gui"* ]]; then
  VMARGS="-Djava.awt.headless=true"
fi
GRAPHVIZ_DOT="/usr/local/opt/graphviz/bin/dot" exec "/usr/local/opt/openjdk/bin/java" $VMARGS -jar /usr/local/Cellar/plantuml/1.2021.0/libexec/plantuml.jar "$@"

plantuml-previewのSettingsの「PlantUML Jar」の項目に貼り付ける。
image.png

もう一度実行すると、プレビューが表示されるようになります。
image.png

参考

https://qiita.com/aminevsky/items/c77b13e4ec6db230ea60
https://springwell.hatenablog.com/entry/2018/05/21/075829
PlantUMLの使い方

2
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?