English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

SpringBoot 프로젝트 생성

다음은 간단한 Spring Boot 프로젝트를 생성하는 단계입니다.

단계1: Spring initializr 열기 https://start.spring.io에 접속하세요。

단계2: 제공했습니다. 그룹그리고 아티펙트이름을 제공했습니다. 그룹 이름 com.w3codebox 과 아티펙트 spring-boot-example

단계3: 이제, 다음을 클릭하세요 Generate (생성)。

"생성" 버튼을 클릭하면, 프로젝트를 다음과 같은 형식으로 패키징 시작합니다: .rar 파일을 다운로드하고 프로젝트를 가져옵니다.

단계4: 추출 RAR 파일

단계5: 가져오기폴더.

파일->가져오기->존재하는 Maven 프로젝트->다음->浏覽->프로젝트 선택->완료

필요한 시간이 소요됩니다. 프로젝트를 성공적으로 가져온 후, 다음과 같은 메뉴에서 프로젝트를 선택할 수 있습니다. 패키지 탐색기 중에서 프로젝트 디렉토리를 확인할 수 있습니다. 아래 그림은 프로젝트 디렉토리를 보여줍니다:

SpringBootExampleApplication .java

package com.w3codebox.springbootexample;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringBootExampleApplication 
{
public static void main(String[] args) 
{
SpringApplication.run(SpringBootExampleApplication.class, args);
}
}

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/boot-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>스프링-boot-스타터-parent</plugin
<version>2.2.2.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.w3코드박스/groupId>
<artifactId>스프링-boot-example/plugin
<version>0.0.1-SNAPSHOT</version>
<name>스프링-boot-example/name>
<description>스프링 부트를 위한 데모 프로젝트</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>스프링-boot-스타터</plugin
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>스프링-boot-스타터-test</plugin
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</plugin
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>스프링-boot-boot-maven/plugin
</artifactId
</plugin
</plugins
build
<repositories>
<pluginRepository>-<pluginRepositories>/id>
milestones/name>
<url>https://repo.spring.io/<name>Spring Milestones/url>
</<repository>
<repositories>
<pluginRepository>-<id>spring/id>
<name>Spring Snapshots/name>
<url>https://repo.spring.io/snapshot/url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</<repository>
</repository
repositories
milestone
<pluginRepository>-<pluginRepositories>/id>
milestones/name>
<url>https://repo.spring.io/<name>Spring Milestones/url>
</pluginRepository>
milestone
<pluginRepository>-<id>spring/id>
<name>Spring Snapshots/name>
<url>https://repo.spring.io/snapshot/url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

단계6: : 실행 SpringBootExampleApplication.java 파일

이 파일을 마우스 오른쪽 버튼으로 클릭하세요-> 실행 방법-> Java 애플리케이션

아래는 애플리케이션이 성공적으로 실행되고 있는 것을 보여줍니다.