IntelliJ에서 Lombok을 설정하여 사용할 수 있다.
Goal
- IntelliJ에서 Lombok Dependency 설정하기
- IntelliJ에서 Lombok Plugin 설정하기
- IntelliJ에서 Enable annotation 설정하기
1. Lombok Dependency 설정
Maven
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<scope>provided</scope>
</dependency>
Gradle
// https://mvnrepository.com/artifact/org.projectlombok/lombok
provided group: 'org.projectlombok', name: 'lombok', version: '1.18.4'
2. Lombok Plugin 설정
- 최초로만 설정하면 된다.
- 설정
- Windows: File > Setting (Ctrl+Alt+S)
- MacOS: Preferences (Cmd + ,)
- Plugins 선택 후 Browse repositorie에서 lombok 검색
- Lombok Plugin (TOOLS INTEGRATION) Install
- IntelliJ Restart
3. Enable annotation 설정
- 설정
- Windows: File > Setting (Ctrl+Alt+S)
- MacOS: Preferences (Cmd + ,)
- Build, Execution, Deployment > Compiler > Annotation Processings
- Enable annotation processing 체크