Search

Gradle ๋ฐฐํฌ (SpringBoot)

Gradle ๋ฐฐํฌ (SpringBoot)

1.
ํ„ฐ๋ฏธ๋„ ์‹คํ–‰
2.
build.gradle ๋นŒ๋“œ ํŒŒ์ผ์ด ์žˆ๋Š” ํ”„๋กœ์ ํŠธ ๊ฒฝ๋กœ๋กœ ์ด๋™
3.
๋ฐฐํฌ ๋ช…๋ น์–ด ์‹คํ–‰
4.
์ž๋ฐ” ํ”„๋กœ๊ทธ๋žจ ์‹คํ–‰ ๋ช…๋ น์–ด ์‹คํ–‰
gradle-wrapper.jar ํŒŒ์ผ์ด ์—†๋Š” ๊ฒฝ์šฐ ์ƒ์„ฑํ•ด์•ผํ•œ๋‹ค.
1.
gradle ์„ค์น˜ Gradle ์„ค์น˜

ํ„ฐ๋ฏธ๋„ ์‹คํ–‰

โ€ข
VS CODE : ctrl + ` ๋˜๋Š” [๋ณด๊ธฐ] > [ํ„ฐ๋ฏธ๋„]

build.gradle ๋นŒ๋“œ ํŒŒ์ผ์ด ์žˆ๋Š” ํ”„๋กœ์ ํŠธ ๊ฒฝ๋กœ๋กœ ์ด๋™

cd ํ”„๋กœ์ ํŠธ๊ฒฝ๋กœ
PowerShell
๋ณต์‚ฌ

๋ฐฐํฌ ๋ช…๋ น์–ด ์‹คํ–‰

./gradlew clean build
PowerShell
๋ณต์‚ฌ
build/libs ํด๋”์— *.war ๋ฐฐํฌํŒŒ์ผ์ด ์ƒ์„ฑ๋œ๋‹ค.

์ž๋ฐ” ํ”„๋กœ๊ทธ๋žจ ์‹คํ–‰ ๋ช…๋ น์–ด ์‹คํ–‰

1.
build/libs ํด๋”๋กœ ์ด๋™
2.
java -jar ์ž๋ฐ” ํ”„๋กœ๊ทธ๋žจ ์‹คํ–‰

build/libs ํด๋”๋กœ ์ด๋™

cd build/libs
PowerShell
๋ณต์‚ฌ

java -jar ์ž๋ฐ” ํ”„๋กœ๊ทธ๋žจ ์‹คํ–‰

java -jar .\spring-docker-0.0.1-SNAPSHOT.war
PowerShell
๋ณต์‚ฌ

gradle wrap

gradle-wrapper.jar ํŒŒ์ผ์€ Gradle Wrapper๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ JAR ํŒŒ์ผ์ž…๋‹ˆ๋‹ค. Gradle Wrapper๋Š” ํ”„๋กœ์ ํŠธ์— ํฌํ•จ๋œ ์ด JAR ํŒŒ์ผ์„ ํ†ตํ•ด ํŠน์ • Gradle ๋ฒ„์ „์„ ๋‹ค์šด๋กœ๋“œํ•˜๊ณ  ํ•ด๋‹น ๋ฒ„์ „์œผ๋กœ ํ”„๋กœ์ ํŠธ๋ฅผ ๋นŒ๋“œํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ค๋‹ˆ๋‹ค.
gradle-wrapper.jar ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์‹œ์Šคํ…œ์— gradle ์ด ์„ค์น˜๋˜์–ด ์žˆ์–ด์•ผํ•˜๊ณ , gradle ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋‹ค.

gradle-wrapper.jar ํŒŒ์ผ ์ƒ์„ฑ

gradle wrap
PowerShell
๋ณต์‚ฌ