IntelliJにPlantUMLプラグインをいれる

開発関連
スポンサーリンク

eclipseと違ってIntelliJって標準だけでも十分優れているのですが、久しぶりにUML書きたくなって調べてみたら便利そうなのがあったので手順を記録しておきます。ちなみにmacにインストールする手順です。

graphvizをインストール

図を描画するツールをインストールします。以下はmacの手順です。
ターミナルを起動して実行してください。

$ brew install graphviz

xcodeが入っていないと下のようなエラーがでます。「xcode-select –install」を実行してインストールしてください。

Error: The following formula
  [#<Dependency: "python" []>, #<Options: []>]
cannot be installed as binary package and must be built from source.
Install the Command Line Tools:
  xcode-select --install

よくわからないエラーが出てきた場合は「brew doctor」を実行してみてください。

Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

↓brew doctorした結果

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or

Sign In - Apple
Sign in with your Apple ID
Warning: The following directories do not exist: /usr/local/Frameworks /usr/local/sbin You should create these directories and change their ownership to your account. sudo mkdir -p /usr/local/Frameworks /usr/local/sbin sudo chown -R $(whoami) /usr/local/Frameworks /usr/local/sbin Warning: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected dylibs: /usr/local/lib/JPKIPKCS11.dylib /usr/local/lib/JPKIPKCS11Auth.dylib /usr/local/lib/JPKIPKCS11Sign.dylib /usr/local/lib/JPKIServiceAPI.dylib Warning: You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: python

となっていたので、その通り実行して解決しました

$ sudo mkdir -p /usr/local/Frameworks /usr/local/sbin
$ sudo chown -R $(whoami) /usr/local/Frameworks /usr/local/sbin
$ brew link python

mac以外の環境の方は↓をみてください。

PlantUMLプラグインをインストール

IntelliJを起動してPreferencesを実行。

PluginsからPlantUMLで検索してインストール&再起動で完了です。

使ってみる

PlantUML Fileを作成。

Nameのところに作りたいファイル名を入れてエンター

設定がうまくいってるとこんな感じで表示されます。下の図はステート図です。

他にもいろいろかけます。詳しくは公式を。

微妙なバランス調整が厳しいけれど、いちいち線ひいたりする手間が省けるので便利かもしれない。

タイトルとURLをコピーしました