πŸ“˜ Programming/❌ ERR

cannot find symbol method builder() μ—λŸ¬ ν•΄κ²° 방법

ν•œμ½”λ”© 2023. 11. 15. 23:04
728x90
728x90

상황

 

builder() ν•¨μˆ˜λ₯Ό 찾지 λͺ»ν•œλ‹€κ³  λœ¨λŠ” μ–΄μ΄μ—†λŠ” μ—λŸ¬λ₯Ό 보고 λ‹Ήν™©ν–ˆμŠ΅λ‹ˆλ‹€. ν”„λ‘œμ νŠΈ λ‚΄λ‚΄ lombok을 μ‚¬μš©ν–ˆλŠ”λ°, ν…ŒμŠ€νŠΈ ν•˜λ €λ‹ˆκΉŒ 찾지 λͺ» ν•˜λŠ” 것 κ°™μŠ΅λ‹ˆλ‹€.


원인

  1. lombok μ˜μ‘΄μ„± 쀑 test κ΄€λ ¨ μ˜μ‘΄μ„±μ„ μΆ”κ°€ν•˜μ§€ μ•ŠμŒ (λ‹Ήμ—°νžˆ μžˆμ„ 쀄 μ•Œμ•˜λŠ”λ°)
  2. lombok μ˜μ‘΄μ„± μΆ”κ°€ν•  λ•Œ μˆœμ„œμ˜ μ€‘μš”μ„±μ„ κ³ λ €ν•˜μ§€ μ•ŠμŒ

ν•΄κ²°

build.gradle

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

 

λ°˜λ“œμ‹œ annotationProcessor (testAnnotationProcessor)보닀 compileOnlyκ°€ μ•žμ— μ‘΄μž¬ν•΄μ•Ό ν•œλ‹€λŠ” μ€‘μš”μ„±μ„ κΉ¨λ‹«λŠ” μ‹œκ°„μ΄μ—ˆμŠ΅λ‹ˆλ‹€.

728x90
λ°˜μ‘ν˜•