인프런 커뮤니티 질문&답변

SeJongDeveloper님의 프로필 이미지

작성한 질문수

실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발

라이브러리 살펴보기

gradlew dependencies

해결된 질문

21.05.20 21:38 작성

·

1.2K

0

안녕하세요. 저는 windows10 사용자입니다.
아래와 같이 인텔리제이 터미널 로컬에 입력하면 실패한다고 뜹니다.

C:\study\jpashop>gradlew dependencies

FAILURE: Build failed with an exception.

* Where:

Build file 'C:\study\jpashop\build.gradle' line: 39

* What went wrong:

A problem occurred evaluating root project 'jpashop'.

> Could not find method testImplementation() for arguments [org.junit.vintage:junit-vintage-engine, build_c5fjxfeq8g2hpdi6kd0zeexhk$_run_closure5@1757541f] on root project 'jpashop' o

f type org.gradle.api.Project.

* 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 1s


=========================================
다음은 환경정보입니다.

C:\study\jpashop>gradlew -version

------------------------------------------------------------

Gradle 6.8.3

------------------------------------------------------------

Build time:   2021-02-22 16:13:28 UTC

Revision:     9e26b4a9ebb910eaa1b8da8ff8575e514bc61c78

Kotlin:       1.4.20

Groovy:       2.5.12

Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020

JVM:          11.0.11 (Oracle Corporation 11.0.11+9-LTS-194)

OS:           Windows 10 10.0 amd64

답변 1

1

김영한님의 프로필 이미지
김영한
지식공유자

2021. 05. 20. 22:01

안녕하세요. SeJongDeveloper님

build.gradle을 메뉴얼 처럼 다음과 같이 설정해보시겠어요?

plugins {
id 'org.springframework.boot' version '2.4.1'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
}

group = 'jpabook'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'

implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.5.6'

compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'

annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
//JUnit4 추가
testImplementation("org.junit.vintage:junit-vintage-engine") {
exclude group: "org.hamcrest", module: "hamcrest-core"
}

}

test {
useJUnitPlatform()
}
SeJongDeveloper님의 프로필 이미지

2021. 05. 21. 20:04

감사합니다.
스프링 부트 2.4.5에서 2.4.1로 내렸더니 정상작동되네요!

김영한님의 프로필 이미지
김영한
지식공유자

2021. 05. 21. 22:45

2.4.5로 테스트해보았는데, 잘 동작하네요. 아마 버전 문제는 아닌 것 같아요.

감사합니다.