eclipse 에서 springboot 프로젝트 를 만 드 는 세 가지 방식 요약

방법 1
STS 플러그 인 설치


플러그 인 가이드 창 설치 완료 후 eclipse 오른쪽 아래 에 플러그 인 설치 진도 가 나타 납 니 다.플러그 인 설치 가 완료 되면 eclipse 를 다시 시작 합 니 다.
새 spring boot 항목


프로젝트 시작

방법 2
1.Maven 프로젝트 만 들 기

2.항목 유형 선택

3.항목 선택

4.프로젝트 그룹 과 이름-finish 를 작성 하면 됩 니 다.

5.pom.xml 파일 수정

<!-- spring boot     -->
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.2.RELEASE</version>
</parent>

6.pom.xml 에 의존 추가

<!--web         -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

7.pom.xml 에 컴 파일 플러그 인 추가

<build>
    <plugins>
    <!-- spring-boot-maven-plugin      spring boot    -->
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins
</build>

8.기본 패키지 와 클래스

9.resources 폴 더 와 application.properties 파일 만 들 기

10.App.java

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

11.HelloController.java

package com.springboot.springbootDemo.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("hello2")
public class HelloController {
       @RequestMapping("")
       public String hello() {
              return "helloworld2";
       }
}

12.시작 항목

13.항목 에 접근(낮은 버 전 으로 접근 할 수 없 을 수도 있 고,2 버 전 으로 사용 가능)
http://localhost:8012/hello2

방법
방문 하 다.http://start.spring.io/

Generate Project 를 누 르 면 프로젝트 압축 패 키 지 를 다운로드 합 니 다.
압축 해제 후,eclipse,Import->Existing Maven Projects->Next->압축 해제 후 폴 더 선택->Finsh,OK done!
이상 은 개인 적 인 경험 이 므 로 여러분 에 게 참고 가 되 기 를 바 랍 니 다.여러분 들 도 저 희 를 많이 응원 해 주시 기 바 랍 니 다.

좋은 웹페이지 즐겨찾기