springboot(20)
-
springboot - RestTemplate 적용
안녕하세요~ 오늘은 스프링부트에서 http통신을 할 때 많이 사용하는 친구입니다. RestTemplate를 적용해보겠습니다. 이제 사용하지 않는가 싶었는데 알아보니 비동기방식이 Deprecated되었군요! 비동기는 webClient를 사용! 동기 방식인 RestTemplate를 적용해보겠습니다. 따로 dependency를 걸 필요는 없습니다. Web을 사용한다면 이미 아래와 같이 디펜던시를 걸었을테니깐요! ㅎㅎ implementation 'org.springframework.boot:spring-boot-starter-web' 이제 필요한건 RestTemplate을 사용할 수 있도록 Bean을 생성하는 것 입니다. @Configuration과 @Bean을 사용해서 아래와 같이 만들어줍니다. @Config..
2024.04.07 -
springboot bootBuildImage
bootBuildImage라는게 있어서 돌려보았습니다. 아래의 오류 메시지가 떴습니다. What the..ㅋㅋ Image name must be in the form '[domainHost:port/][path/]name', with 'path' and 'name' containing only [a-z0-9][.][_][-] bootBuildImage관련해서 아래의 사이트나 help를 통해 알아봅시다. https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#build-image ./gradlew help --task :bootBuildImage ./gradlew help --task :bootBuildImage..
2024.03.21 -
springboot profiles
profiles? 이녀석은 언제 사용하는가? 바로 우리가 만든 어플리케이션을 환경에 따라 기동을 시킬때 필요한 내용 입니다. 환경에 따라 기동을 한다는건 로컬에서 실행을하거나 개발서버에서 실행을 한다거나 할때 즉, 개발환경 dev, staging, prod(real)을 뜻 합니다. 보통 배포를 할 때 필요합니다. 로컬에서 개발하다가 개발환경으로 올려서 테스트 하기 위해 배포할 때(혹은 prod) 로컬과 개발환경은 구분되어야 합니다. 여기서 구분되어야할 것은 db설정 같은 정보 입니다. profiles 구성 방법 첫번째 profiles는 보통 하나의 application.yaml에서 구분해서 가져오거나 두번째 application.yaml 즉, 파일 자체를 구분해서 가져올수 있는 방법 2가지 정도로 보시면..
2024.03.03 -
springboot 배너변경..ㅋㅋ;;
이게 뭐냐면.. . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v3.2.0) 스프링부트가 기동할 때 뜨는 문구이다. springboot관련해서 재미난거 같아서 해보았다ㅋㅋ 아래 표처럼 배너변수들을 사용할 수 가 있다. Table 1. Banner variablesVariableDescription ${application.version}..
2024.02.29 -
gradle - Could not resolve all dependencies for configuration ':detachedConfiguration4'.Using insecure protocols with repositories, without explicit opt-in, is unsupported.
넥서스에 있는 것을 가져오려는데 오류가 났다. 에러발생 Could not resolve all dependencies for configuration ':detachedConfiguration4'.Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://maven.xxx.com/어쩌구저쩌구)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.4.1/dsl/org.gradle.api.artifacts.repo..
2022.05.09 -
springboot error - Could not write JSON: Can not start an array, expecting field name (context: Object)
에러 발생 .HttpMessageNotWritableException: Could not write JSON: Can not start an array, expecting field name (context: Object); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not start an array, expecting field name (context: Object) (through reference chain: org.springframework.hateoas.EntityModel["content"])] 위의 에러는 테스트 코드를 돌리는데 발생. @Test @DisplayName("입력 값이 잘못된 경우에..
2022.03.25