스프링 부트 3.X 버전으로 바꾸려면
[질문 템플릿]
1. 강의 내용과 관련된 질문인가요? (예)
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예)
3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예)
[질문 내용]
강의 내용대로
itemservice-db-start를 이름 수정해서 쓰려고 했는데
이 코드는 스프링 부트 2.X 버전이더라고요.
이렇게 강의에서 제공하는 코드가 2.X 버전인 경우, 저는 이전 MVC 2편 강의 들을 땐 제가 스프링 이니셜라이저 사이트에 가서 직접 프로젝트를 3.X 버전으로 하나 만들고, 강의에서 제공하는 코드에서 main 폴더랑 test 폴더만 제가 만든 프로젝트 쪽으로 복사 + 붙여넣기 하는 식으로 해결했었습니다.
이번에도 그런 식으로 했고 실행해서 상품 등록이랑 수정해 보니 오류는 딱히 안 나는데 조금 걱정되는 부분이 있어서 질문드립니다.
강의에서 제공하는 코드를 보면

modules 폴더나 sql 폴더가 있습니다. 제가 새로 만든 프로젝트엔 없고요. 그래서 위 폴더들도 그대로 복사 붙여넣기 할까 생각도 했는데.. 위 두 개 폴더 말고도 더 있을지도 모르고, 이런 식으로 없는 폴더를 일일이 복사 붙여넣기 해서 무언가 잘못되어서 나중에 가서 오류가 터질까 봐 조금 걱정이 되네요.
조금 안전한 방법으로 스프링 부트 3.X 코드를 쓰고 싶은데, 제가 그동안 했던 방법으론 조금 불안합니다..ㅎㅎ
관련 질문과 답변이 MVC 2편 커뮤니티엔 많은데, DB 2편 커뮤니티엔 없는 것 같아서 질문드립니다.
스프링 부트 3.X로 하려면 어떻게 하는 게 좋을까요?
그냥 2.X 버전으로 진행해도 아무 문제 안 생긴다면 2.X로 해도 상관은 없습니다.
+)
그냥 강의에서 제공하는 스프링 부트 2.X 버전 코드에 추가로
이 게시글대로 해 보고, 여기에 추가로
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.
답변 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





