반응형

Spring boot Tips


  • spring-boot 에서 spring-boot-starter-data-* 관련 dependency 들을 추가하면 'mysql-connector-java' 같은 connector를 추가해야 합니다.
  • no profiles are currently active 가 뜨면 spring.profiles.active=@activeProfile@ 설정을 해야 합니다.
  • gradle 로 구동 시 -Dspring.profiles.active= 를 하더라도 되지 않는 경우가 있는데 아래와 같이 설정해 주어야 합니다.
bootRun {
systemProperties System.properties
}


테스트 케이스에서 ConfigurationProperties나 lombok으로 인해 gradle build 실패

  • spring boot configuration annotation processor not found in classpath 
    • Spring-Boot2에서 ConfigurationProperties 관련 에러가 발생
    • Spring-Doc 문서 참고 - spring-boot-configuration-processor 관련 설정 추가
    • Gradle 버전마다 다를 수 있으니 유의

annotationPorcessor('org.springframework.boot:spring-boot-configuration-processor')
compile('org.springframework.boot:spring-boot-configuration-processor')

annotationPorcessor('org.projectlombok:lombok')
compile('org.projectlombok:lombok)




반응형

+ Recent posts