본문 바로가기
Tools

[IntelliJ] PlantUML Integration 플러그인 설치 및 사용법

by A6K 2023. 4. 30.

소프트웨어 개발에 있어 문서화의 중요성은 매번 강조된다. 그 중에 UML(Unified Modeling Language) 다이어그램은 가장 많이 사용되는 도구 중 하나다.

PlantUML은 텍스트만으로도 UML 다이어그램을 그릴 수 있게 도와주는 오픈소스 소프트웨어다. 인텔리제이에는 PlantUML을 이용해 UML 다이어그램을 그릴 수 있는 PlantUML Integration 플러그인이 있다.

PlantUML Integration 플러그인 설치

Settings > Plugins > Marketplace 에서 PlantUML Integration을 검색하자.

Install 버튼을 눌러 설치한 후 인텔리제이를 재시작하자.

PlantUML Integration 사용법

이제 인텔리제이에서 새로운 파일을 생성할 때, PlantUML 파일을 만들 수 있다.

 

New > PlantUML File 항목을 선택하면

생성할 UML 다이어그램을 선택할 수 있다. 테스트로 Class를 선택해보자.

확장자명이 .puml인 파일이 생성되었다. 이 파일에 PlantUML 텍스트를 사용해 다이어그램을 그면 된다.

Dot Executable: /opt/local/bin/dot
File does not exist
Cannot find Graphviz. You Should try

@staruml
testdot
@enduml

 or 
 
 java -jar plantuml.jar -testdot

만약 사용중인 환경에 graphviz 가 설치되어 있지 않다면 위와 같이 다이어그램을 확인할 수 없다.

brew install libtool
brew link libtool
brew install graphviz
brew link --overwrite graphviz

홈브루를 이용해서 graphviz 패키지를 설치해주자. 다른 운영체제인 경우 PlantUML 홈페이지를 참고해서 GraphViz를 설치하자.

graphviz를 설치한 이후

$ witch dot
/opt/homebrew/bin/dot

dot 설치 경로를 확인한 다음

Settings > Languages & Framworks > PlantUML 에서 Graphviz dot executable 항목에 witch dot 명령어로 얻어온 경로를 적어주면된다.

이제 정상적으로 UML 다이어그램이 그려진다. 이제 PlantUML 홈페이지를 참고하여 다이어그램을 그리면 된다.

댓글