Intellij Spring Boot - 프로젝트 생성

less than 1 minute read

Spring Boot - 프로젝트 생성 (1)

  • Create Project

  • 프로젝트 구조

    • pom.xml
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
      
      spring-boot-starter-web : RESTful, SpringMVC, Tomcat을 포함하고 있음
    • DemoApplication.java
        @SpringBootApplication
        public class DemoApplication {
      
            public static void main(String[] args) {
                SpringApplication.run(DemoApplication.class, args);
            }
      
        }		
      
      @SpringBootApplication : @EnableAutoConfiguration, @ComponentScan, @Configuration 을 포함하고 있는 어노테이션
  • Run

    • /src/main/resources/index.html 추가
        <!DOCTYPE html>
        <html lang="en">
        <head>
                <meta charset="UTF-8">
                <title>Home</title>
        </head>
        <body>
        Home
        </body>
        </html>		
      
    • Run Application

    • 결과 화면

스프링부트 시작하기 (SpringBoot 프로젝트 설정 방법)
스프링부트(SpringBoot) @SpringBootApplication

Leave a comment