공부
[스프링 부트와 AWS로 혼자 구현하는 웹 서비스]build.gradle 오류 해결. gradle 반영 reload하기_윈도우
happyeuni
2022. 6. 21. 11:05
- 책에 나와있는 대로 compile() testCompile() 하면 오류나고 compielClasspath() , testCompileClasspath() 로 해야 오류가 해결된다.
- jcenter가 더이상 지원되지 않아 일단 주석처리를 하였다.
buildscript {
ext {
springBootVersion = '2.1.7.RELEASE'
}
repositories {
mavenCentral()
// jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group 'com.jojoldu.book'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compileClasspath('org.springframework.boot:spring-boot-starter-web')
testCompileClasspath('org.springframework.boot:spring-boot-starter-test')
// compile('org.springframework.boot:spring-boot-starter-web')
// testCompile('org.springframework.boot:spring-boot-starter-test')
}
- gradle을 변경하면 책에는 반영하라는 알람이 오른쪽 아래에 나온다고 하였는데 나는 뜨지 않았다.
반영법은 View > Tool Windows > Gradle 을 누르면 오르쪽에 창이 뜨는데 거기서 새로고침 표시를 눌러주면 된다.
혹은 아래 창에서 build > 마우스 우클릭> Reload Gradle Project 를 눌러도 간단하게 새로고침하여 반영 할 수 있다.