본문 바로가기

학습/Gradle3

[gradle] gradle 5부터 lombok의 설정을 신경써야 한다 오류 상황 //build.gradle dependencies { //Util implementation "org.projectlombok:lombok" } //오류 메세지 error: variable courseRepository not initialized in the default constructor - build.gradle에 implementation으로 lombok 의존성을 추가하고, Intellij 프로젝트에서도 enable annotation processing 옵션을 활성화한 상태 - 그런데 @RequiredArgsConstructor를 선언한 Service에서 default constructor를 사용하게 됨 - 결국 생성자에 필요한 인자인 courseRepository를 주입받지 못하.. 2020. 6. 14.
[gradle] api와 implementation api (= old compile keyword) gradle 3.0부터 deprecated된 compile을 대체! transitive dependency들도 consumer에게 라이브러리 노출 O transitive dependency들도 consumer의 classpath에 포함 O implementation transitive dependency들은 consumer에게 라이브러리 노출 X transitive dependency들은 consumer의 classpath에 포함 X 그래서 노출될 필요 없는 의존성들은 api(compile)보다 implementation을 권장 api와 implementation 예시 api : 의존 라이브러리 수정 시, 해당 라이브러리를 포함하게 되는 모든 모듈 rec.. 2020. 4. 26.
[gradle] buildscript block의 용도 gradle buildscript 소스코드를 빌드하고 실행하는데 필요한 글로벌 레벨의 depencies & repositories 설정 build.gradle 파일 그 자체를 위한 것. Package Manager / Docker file / spirng-boot-gradle-plugin과 같이 빌드에 필요한 의존성 추가 따라서 소스코드 컴파일과 같은 빌드 작업을 시작하기 전에, 빌드 시스템 준비 단계에서 제일 먼저 실행되는 블록 결국 빌드 자체를 위한 의존성 & 레포를 설정하는 곳 출처 https://stackoverflow.com/questions/17773817/purpose-of-buildscript-block-in-gradle 2020. 3. 23.