본문 바로가기
강의 실습/스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

빌드하고 실행하기

by jint 2026. 2. 26.

1. 빌드하고 실행하기
- macOS
터미널로 이동
1) ./gradlew build 또는 ./gradlew clean build
2) cd build/libs
3) java -jar hello-spring-0.0.1-SNAPSHOT.jar
4) 실행 확인

- Windows
명령 프롬프트(cmd)로 이동
1) gradlew.bat 실행할 때 gradlew 명령어를 입력하면 된다.
2) gradlew build
3) dir

- CMD

C:\Users\admin\IdeaProjects\hello-spring>gradlew build

Welcome to Gradle 9.3.1!

Here are the highlights of this release:
 - Test reporting improvements
 - Error and warning improvements
 - Build authoring improvements

For more details see https://docs.gradle.org/9.3.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

BUILD SUCCESSFUL in 14s
7 actionable tasks: 7 executed
Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.3.1/userguide/configuration_cache_enabling.html
C:\Users\admin\IdeaProjects\hello-spring>cd build\libs

C:\Users\admin\IdeaProjects\hello-spring\build\libs>dir
 C 드라이브의 볼륨: win11
 볼륨 일련 번호: CA42-51D9

 C:\Users\admin\IdeaProjects\hello-spring\build\libs 디렉터리

2026-02-26  오후 11:12    <DIR>          .
2026-02-26  오후 11:12    <DIR>          ..
2026-02-26  오후 11:12             2,780 hello-spring-0.0.1-SNAPSHOT-plain.jar
2026-02-26  오후 11:12        21,274,397 hello-spring-0.0.1-SNAPSHOT.jar
               2개 파일          21,277,177 바이트
               2개 디렉터리  765,955,399,680 바이트 남음

C:\Users\admin\IdeaProjects\hello-spring\build\libs>java -jar hello-spring-0.0.1-SNAPSHOT.jar

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v4.0.3)

2026-02-26T23:14:33.332+09:00  INFO 39388 --- [hello-spring] [           main] h.hello_spring.HelloSpringApplication    : Starting HelloSpringApplication v0.0.1-SNAPSHOT using Java 17.0.17 with PID 39388 (C:\Users\admin\IdeaProjects\hello-spring\build\libs\hello-spring-0.0.1-SNAPSHOT.jar started by admin in C:\Users\admin\IdeaProjects\hello-spring\build\libs)
2026-02-26T23:14:33.338+09:00  INFO 39388 --- [hello-spring] [           main] h.hello_spring.HelloSpringApplication    : No active profile set, falling back to 1 default profile: "default"
2026-02-26T23:14:34.162+09:00  INFO 39388 --- [hello-spring] [           main] o.s.boot.tomcat.TomcatWebServer          : Tomcat initialized with port 8080 (http)
2026-02-26T23:14:34.171+09:00  INFO 39388 --- [hello-spring] [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2026-02-26T23:14:34.171+09:00  INFO 39388 --- [hello-spring] [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/11.0.18]
2026-02-26T23:14:34.195+09:00  INFO 39388 --- [hello-spring] [           main] b.w.c.s.WebApplicationContextInitializer : Root WebApplicationContext: initialization completed in 806 ms
2026-02-26T23:14:34.271+09:00  INFO 39388 --- [hello-spring] [           main] o.s.b.w.a.WelcomePageHandlerMapping      : Adding welcome page: class path resource [static/index.html]
2026-02-26T23:14:34.495+09:00  INFO 39388 --- [hello-spring] [           main] o.s.boot.tomcat.TomcatWebServer          : Tomcat started on port 8080 (http) with context path '/'
2026-02-26T23:14:34.503+09:00  INFO 39388 --- [hello-spring] [           main] h.hello_spring.HelloSpringApplication    : Started HelloSpringApplication in 1.545 seconds (process running for 1.942)
2026-02-26T23:14:40.744+09:00  INFO 39388 --- [hello-spring] [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2026-02-26T23:14:40.745+09:00  INFO 39388 --- [hello-spring] [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2026-02-26T23:14:40.747+09:00  INFO 39388 --- [hello-spring] [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
2026-02-26T23:14:45.581+09:00  INFO 39388 --- [hello-spring] [ionShutdownHook] o.s.boot.tomcat.GracefulShutdown         : Commencing graceful shutdown. Waiting for active requests to complete
2026-02-26T23:14:45.731+09:00  INFO 39388 --- [hello-spring] [tomcat-shutdown] o.s.boot.tomcat.GracefulShutdown         : Graceful shutdown complete



참고링크 : https://www.inflearn.com/course/%EC%8A%A4%ED%94%84%EB%A7%81-%EC%9E%85%EB%AC%B8-%EC%8A%A4%ED%94%84%EB%A7%81%EB%B6%80%ED%8A%B8?cid=325630

 

[지금 무료]스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술| 김영한 - 인프런 강의

현재 평점 5.0점 수강생 120,487명인 강의를 만나보세요. 스프링 입문자가 예제를 만들어가면서 스프링 웹 애플리케이션 개발 전반을 빠르게 학습할 수 있습니다. 예제를 만들면서 자연스럽게 스

www.inflearn.com

댓글