inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

스프링 DB 2편 - 데이터 접근 활용 기술

프로젝트 설정과 메모리 저장소

스프링 부트 3.X 버전으로 바꾸려면

해결된 질문

302

11 1

작성한 질문수 147

0

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

[질문 내용]


강의 내용대로

itemservice-db-start를 이름 수정해서 쓰려고 했는데
이 코드는 스프링 부트 2.X 버전이더라고요.

 

이렇게 강의에서 제공하는 코드가 2.X 버전인 경우, 저는 이전 MVC 2편 강의 들을 땐 제가 스프링 이니셜라이저 사이트에 가서 직접 프로젝트를 3.X 버전으로 하나 만들고, 강의에서 제공하는 코드에서 main 폴더랑 test 폴더만 제가 만든 프로젝트 쪽으로 복사 + 붙여넣기 하는 식으로 해결했었습니다.

 

이번에도 그런 식으로 했고 실행해서 상품 등록이랑 수정해 보니 오류는 딱히 안 나는데 조금 걱정되는 부분이 있어서 질문드립니다.

 

강의에서 제공하는 코드를 보면

gn.jpg.webp

modules 폴더나 sql 폴더가 있습니다. 제가 새로 만든 프로젝트엔 없고요. 그래서 위 폴더들도 그대로 복사 붙여넣기 할까 생각도 했는데.. 위 두 개 폴더 말고도 더 있을지도 모르고, 이런 식으로 없는 폴더를 일일이 복사 붙여넣기 해서 무언가 잘못되어서 나중에 가서 오류가 터질까 봐 조금 걱정이 되네요.

 

조금 안전한 방법으로 스프링 부트 3.X 코드를 쓰고 싶은데, 제가 그동안 했던 방법으론 조금 불안합니다..ㅎㅎ

 

관련 질문과 답변이 MVC 2편 커뮤니티엔 많은데, DB 2편 커뮤니티엔 없는 것 같아서 질문드립니다.

스프링 부트 3.X로 하려면 어떻게 하는 게 좋을까요?

그냥 2.X 버전으로 진행해도 아무 문제 안 생긴다면 2.X로 해도 상관은 없습니다.

 

 

 

+)

그냥 강의에서 제공하는 스프링 부트 2.X 버전 코드에 추가로

 

https://www.inflearn.com/community/questions/988208/%EC%9E%90%EB%B0%94-17%EC%9D%80-%EC%96%B4%EB%96%BB%EA%B2%8C-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8%EB%A5%BC-%EC%A7%84%ED%96%89%ED%95%B4%EC%95%BC-%ED%95%98%EB%82%98%EC%9A%94

 

이 게시글대로 해 보고, 여기에 추가로

plugins {
    id 'org.springframework.boot' version '3.3.2'
    id 'io.spring.dependency-management' version '1.1.6'
    id 'java'
}

이 부분만 3.3.2랑 1.1.6으로 수정해 봤는데요.(스프링 부트 3 이상으로 바꾸기 위해)

이렇게 하니깐 다음 메시지가 뜹니다.

 

강의 코드를 수정해야 할지, 아니면 제가 새로 프로젝트를 만들어서 수정해야 할지, 그러면 복붙을 어디어디 할지 모르겠네요..

 

A problem occurred configuring root project 'itemservice-db'.

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

> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.3.2.

Required by:

project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.3.2

> No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.3.2 was found. The consumer was configured to find a runtime of a library compatible with Java 17, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.2' but:

- Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.3.2 declares a library compatible with Java 17, packaged as a jar, and its dependencies declared externally:

- Incompatible because this component declares an API of a component and the consumer needed a runtime of a component

- Other compatible attribute:

- Doesn't say anything about org.gradle.plugin.api-version (required '7.2')

- Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.3.2 declares a runtime of a component, and its dependencies declared externally:

- Incompatible because this component declares documentation and the consumer needed a library

- Other compatible attributes:

- Doesn't say anything about its target Java version (required compatibility with Java 17)

- Doesn't say anything about its elements (required them packaged as a jar)

- Doesn't say anything about org.gradle.plugin.api-version (required '7.2')

- Variant 'modernGradleRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.3.2 declares a runtime of a library compatible with Java 17, packaged as a jar, and its dependencies declared externally:

- Incompatible because this component declares a component, as well as attribute 'org.gradle.plugin.api-version' with value '8.7' and the consumer needed a component, as well as attribute 'org.gradle.plugin.api-version' with value '7.2'

- Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.3.2 declares a runtime of a library compatible with Java 17, packaged as a jar, and its dependencies declared externally:

- Incompatible because this component declares a component, as well as attribute 'org.gradle.plugin.api-version' with value '7.5' and the consumer needed a component, as well as attribute 'org.gradle.plugin.api-version' with value '7.2'

- Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.3.2 declares a runtime of a component, and its dependencies declared externally:

- Incompatible because this component declares documentation and the consumer needed a library

- Other compatible attributes:

- Doesn't say anything about its target Java version (required compatibility with Java 17)

- Doesn't say anything about its elements (required them packaged as a jar)

- Doesn't say anything about org.gradle.plugin.api-version (required '7.2')

* 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.

 

spring mvc jpa querydsl spring-data-mybatis spring-jpa

답변 1

2

David

안녕하세요. 11 1님, 공식 서포터즈 David입니다.

현재 프로젝트에 설정된 JDK가 17이상인지 확인해 주세요.

.idea 폴더 내 파일은 Intellij 설정과 관련된 것이므로 굳이 옮기실 필요가 없고 오류가 발생하더라도 설정으로 바로 잡을 수 있는 부분들입니다.

sql 폴더만 옮겨주시면 됩니다:)

감사합니다.

0

11 1

답변 감사합니다! 괜한 걱정이었네요.

RepositoryTest의 패키지 위치가 domain인 이유

0

30

2

REQUIRES_NEW 해결 방법에 대해서 질문있습니다!!

0

30

1

update()에 사용하는 setter 질문드립니다.

0

47

1

SQL 중심적 개발의 문제점에 대한 질문

0

72

1

혹시 Containing 을 안쓰신 이유가 있을까요?

0

83

2

[공유] 스프링부트 4.x 버전 mybatis 연동

0

174

1

@repository 어노테이션

0

89

3

ItemService

0

58

1

논리 커밋, 물리 커밋 질문드립니다.

0

54

1

내부 트랜잭션 커밋은 필수인가요?

0

57

1

프록시 커넥션 객체를 반환할 때 생성하는건가요?

0

54

1

Transaction readOnly 성능 개선 (김영한님의 대한 감사인사)

2

178

2

JPQL 대신 네이티브 쿼리를 사용해야 하는 경우

0

77

1

@EventListener(ApplicationReadyEvent.class) 관련

0

88

1

트랜잭션 동기화 매니저와 데이터 소스

0

76

1

DB 관련 강의 개설 계획은 없으신건가요?

0

133

2

물리 트랜잭션 과 논리트랜잭션 용어를 맞게 이해한걸까요

0

94

1

스프링 3 버전 이상 rollbackFor 변경된듯요

1

112

1

트랜잭션 전파 질문.

0

87

1

프로젝트 오픈 에러

0

126

1

외부 트랜잭션에서 isNewTransaction이 false로 나오는거에 대해 질문드립니다

0

83

2

같은 스레드를 사용하면 트랜잭션 동기화 매니저는 같은 커넥션을 반환

0

72

1

h2 인메모리 테스트중 예약어 충돌날 경우 대처방법

0

102

1

커스텀aop와 트랜잭션을 같이 사용할때 우선순위에 관한 질문

0

98

2