inflearn logo
강의

Course

Instructor

Spring MVC Part 2 - Backend Web Development Application Techniques

Bean Validation - Getting Started

Could not resolve org.springframework.boot:spring-boot-starter-validation:2.4.4

43

작성자 없음

0 asked

0


[질문 템플릿]
1. 강의 내용과 관련된 질문인가요? (예)
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예)
3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예)

[질문 내용]
eclipse 환경에서 validation 예제를 따라가고 있었는데 Bean Validation 강의부터 라이브러리가 다운받아지지 않습니다.

Could not resolve: org.springframework.boot:spring-boot-starter-validation:2.4.4

image.png

위와 같은 메세지가 출력되면서 외부 의존성 라이브러리를 확인해봤을 때, jakarta.validation-api

hibernate-validator 라이브러리가 추가되지 않는 것을 확인했습니다. 검색해도 해결방안을 찾지 못해 질문 남깁니다. 어떻게 해결할 수 있을까요?

 

추가로 Eclipse는 4.16.0 버전 사용중입니다.

spring mvc

Answer 2

0

yuj0261142

gradle 프로젝트를 터미널에서 직접 refresh 시도를 했는데 다음과 같은 오류가 발생했습니다.

 

D:\study\mvc2\validation-start>gradlew build --refresh-dependencies

Starting a Gradle Daemon, 3 incompatible Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:

A problem occurred configuring root project 'validation'.

> Could not resolve all artifacts for configuration ':classpath'.

   > Could not resolve org.springframework.boot:spring-boot-buildpack-platform:2.4.4.

     Required by:

         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:2.4.4 > org.springframework.boot:spring-boot-gradle-plugin:2.4.4

      > Could not resolve org.springframework.boot:spring-boot-buildpack-platform:2.4.4.

         > Could not get resource 'https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-buildpack-platform/2.4.4/spring-boot-buildpack-platform-2.4.4.pom'.

            > Could not HEAD 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-buildpack-platform/2.4.4/spring-boot-buildpack-platform-2.4.4.pom'.

               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

   > Could not resolve org.springframework.boot:spring-boot-loader-tools:2.4.4.

     Required by:

         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:2.4.4 > org.springframework.boot:spring-boot-gradle-plugin:2.4.4

      > Could not resolve org.springframework.boot:spring-boot-loader-tools:2.4.4.

         > Could not get resource 'https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-loader-tools/2.4.4/spring-boot-loader-tools-2.4.4.pom'.

            > Could not HEAD 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-loader-tools/2.4.4/spring-boot-loader-tools-2.4.4.pom'.

               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

   > Could not resolve org.apache.commons:commons-compress:1.20.

     Required by:

         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:2.4.4 > org.springframework.boot:spring-boot-gradle-plugin:2.4.4

      > Could not resolve org.apache.commons:commons-compress:1.20.

         > Could not get resource 'https://plugins.gradle.org/m2/org/apache/commons/commons-compress/1.20/commons-compress-1.20.pom'.

            > Could not HEAD 'https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.20/commons-compress-1.20.pom'.

               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

   > Could not resolve org.springframework:spring-core:5.3.5.

     Required by:

         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:2.4.4 > org.springframework.boot:spring-boot-gradle-plugin:2.4.4

      > Could not resolve org.springframework:spring-core:5.3.5.

         > Could not get resource 'https://plugins.gradle.org/m2/org/springframework/spring-core/5.3.5/spring-core-5.3.5.pom'.

            > Could not HEAD 'https://repo.maven.apache.org/maven2/org/springframework/spring-core/5.3.5/spring-core-5.3.5.pom'.

               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s

 

0

communityai8509

안녕하세요, 인프런 AI 인턴입니다. 연우님.

Eclipse 환경에서 Spring Boot 프로젝트의 특정 Dependency를 해결하지 못하는 문제는 종종 발생할 수 있습니다. 이는 보통 Gradle 설정이나 네트워크 문제로 인해 발생될 수 있습니다. 다음 몇 가지 해결 방법을 시도해 보십시오:

  1. build.gradle 파일 확인: 해당 의존성을 올바르게 설정했는지 확인해 주세요. 버전 번호(2.4.4)가 정확한지 다시 한번 확인하세요. spring-boot-starter-validation 의존성은 명확하게 추가되어 있어야 합니다.
   dependencies {
       implementation 'org.springframework.boot:spring-boot-starter-validation:2.4.4'
   }
  1. Maven Central 사용: Gradle이 의존성을 다운로드할 수 있도록 Maven Central을 방법으로 명시하십시오.
   repositories {
       mavenCentral()
   }
  1. Gradle 캐시 삭제: 프로젝트의 문제일 수 있으니, Gradle 캐시를 삭제한 후 다시 빌드해 보세요. 명령어 ./gradlew clean 또는 gradle clean을 실행한 후 ./gradlew build를 시도해 보세요.

  2. 인터넷 연결 확인: 의존성은 Maven Repository에서 다운로드되므로 인터넷 연결이 원활한지 확인하세요.

  3. Gradle Wrapper 업데이트: Gradle의 버전이 낮은 경우, 최신 버전으로 Gradle Wrapper를 업데이트하는 것도 해결책이 될 수 있습니다. gradle-wrapper.properties 파일을 수정하여 더 최신의 Gradle 버전을 사용해 보세요.

만약 위의 방법으로도 해결되지 않는다면, 다음의 추가 정보를 포함하여 인프런 Q&A에 다시 질문을 남겨주시면 보다 정확한 도움을 받을 수 있습니다:
- build.gradle 또는 pom.xml 파일의 전체 내용
- 사용 중인 Spring Boot 버전과 Eclipse 버전

현재 관련있는 질문이 아래 포함되어 있으며, 참고하시기 바랍니다:
- Can’t resolve dependency 관련 질문: 여기에서 의존성 문제 해결을 위한 또 다른 방법을 찾아볼 수 있습니다.

저는 질문자님의 이해를 돕고자 지식공유자님의 기존 답변을 참고하여 유사한 답변 링크를 추천해드리고 있습니다.
현재 베타 기능으로 답변이 만족스럽지 않을 수 있는 점 양해 부탁드립니다. 🙏
추가적으로 궁금한 점이 있으시면, 이어서 질문해 주세요. 곧 지식공유자께서 답변해 주실 것입니다.

이미지 업로드와 db 트랜잭션 묶는법

0

35

1

MessageSourceTest 코드

0

42

1

인터셉터 에러 설정

0

45

1

resolveArgument()메서드 질문

0

52

1

43강 검증1 에서 실패 로직 관련 질문있습니다.

0

52

2

타임리프 3.X 버전 rendering, serializer 에러 해결 방법

2

129

3

스프링 빈에 등록이 안되는거 같은데 어떻게 하면 좋을까요?ㅠㅠ

0

86

3

pdf 오타 문의

0

54

1

ItemUpdateForm 검증 관련 질문입니다.

0

46

1

22page 링크 주소 변경

0

54

2

특정 데이터와 파일을 함께 저장 시, 테이블 구조 질문

0

52

1

섹션3번 수업에 대한 질문입니다.

0

78

2

@Autowired 보다 더 좋은 방법이 어떤 걸까요?

0

84

2

타입컨버터 가 람다랑 비슷해 보이는데 저의 생각이 맞는지?.

0

63

1

자바스크립트 인라인에서 객체 직렬화 시 오류가 납니다

0

140

3

스프링부트 - 오류페이지2 에서 500.html 에서 쓰인 객체 질문

0

61

1

톰캣 에러 페이지가 안보입니다.

0

98

2

apiEceptionController에서 센드 에러 호출하면 안되는지?

0

80

1

세션 타임아웃시 쿠키 삭제 방법이 없나요?

0

116

2

ApiExceptionController 질문드립니다.

0

62

1

셀렉박스 챕터에서 option value에 ==배송 방식 선택== 이것을 넣은 이유가 궁금함, 이렇게 구상해도 되는지?

0

62

1

MemberRepository 필드의 fianl 선언 유무

0

80

2

혹시 index.html 에서는 fragment 사용이 안되는건가요

0

56

1

helloMessage테스트 오류

0

129

2