gradle dependency configuration에 대해서

nahy·2024년 7월 19일

Spring

목록 보기
3/6

Lombok

Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java.
Never write another getter or equals method again, with one annotation your class has a fully featured builder, Automate your logging variables, and much more.

대충 어노테이션으로 getter, equals 등등의 메서드, 빌더, 로깅 변수 자동화같은 기능을 제공한다는 뜻이다.

Lombok을 springBoot 프로젝트에 적용해 보겠다.

라이브러리 추가하기

Maven Repository 로 가서 Lombok을 검색한다.

원하는 버전을 클릭해서 들어가면 ~

여러 빌드 도구에 맞춰 필요한 명령어를 알려준다.
내 springBoot 프로젝트의 빌드 도구는 Gradle이니까 저걸 복사해 준다.

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-web'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
	testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

	compileOnly 'org.projectlombok:lombok:1.18.34'
}

별도 버전 지정이 없으면 lombok은 스프링에서 권장되는 버전으로 깔린다.
사실 이거 한줄만 추가하면 제대로 lombok 라이브러리를 쓸 수 없다.

settings에서 플러그인을 추가해 줘야 한다.

dependency configuration

... 다음에 계속
여기가 본론이다..&^^^

profile
ggg...

0개의 댓글