티스토리 뷰

spring boot 실시간 hot deploy하기

 

https://stackoverflow.com/questions/23155244/spring-boot-hotswap-with-intellij-ide

https://dzone.com/articles/spring-boot-application-live-reload-hot-swap-with

참고는 여기

 

스프링 프로젝트를 빌드하고 나서 hot deploy설정을 해주는데 기존에 하던 프로젝트면 설정을 이미 해놓아서 괜찮은데 실시간 반영 되게 핫 디플로이 설정을 하려면 자주 하는 설정이 아니라서 매번 찾아보아야 했다. 그래서 올려놓는다.

 

방법은

1.spring-boot-devtools를 라이브러리에 추가한다.

2.intelli j 에서 설정한다.

3.ctrl + shift + A -> registry -> compiler.automake.allow.when.app.running 추가

 

하나씩 해보자.

https://mvnrepository.com/  여기에 가서 spring-boot-devtools를 검색 하면 찾을 수 있다.

맨 위에꺼 누른다

 

 

여기서도 지금 최신인거 맨 위에꺼 눌렀다.

 

난 그래들을 쓰기 때문에 맨위에서 두번째 탭인 'Gradle'을 눌렀다.

나오는걸 복사한다.

 

이제 인텔리제이로 가서 build.gradle에 복사한걸 붙여넣기 한다.

 

build.gradle

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
buildscript {
    ext {
        springBootVersion = '1.5.10.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}
 
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
 
group = 'com.plutus'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
 
repositories {
    mavenCentral()
}
 
 
dependencies {
    //
 
    runtime('com.h2database:h2')
    compileOnly('org.projectlombok:lombok')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools
    compile group: 'org.springframework.boot', name: 'spring-boot-devtools', version: '1.5.10.RELEASE'
 
}
 
cs

dependencies{}여기 블럭 맨 아래에 한줄 'spring-boot-devtools'가 추가했으면 잘 한 것이다.

 

 

2021.2월 이후 변경 됨

[intellij] SpringBoot Devtools Remote LiveReload 설정 (tistory.com)

 

[intellij] SpringBoot Devtools Remote LiveReload 설정

SpringBoot 설정 SpringBoot LiveReload Document https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using.devtools.remote-applications Spring Boot Reference Documentation This secti..

freedeveloper.tistory.com

 

end.

 

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함