해결된 질문
작성
·
1.3K
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
안녕하세요. 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()
}
감사합니다.
스프링 부트 2.4.5에서 2.4.1로 내렸더니 정상작동되네요!