Eclipse搭建springboot

Eclipse搭建springboot


第一次写博客,有点不知所措。。。。直接上操作吧!

一、新建maven project
Eclipse搭建springboot_第1张图片
连续点击next,进入如下界面:
Eclipse搭建springboot_第2张图片
其中group id是你启动类的包,Artifact id是你的项目名,输入项目名,点击next,等待创建完毕,这是我的项目结构
Eclipse搭建springboot_第3张图片
接下来进入pom.xml添加springboot的jar,这是我的pom文件


	4.0.0

	com.yl
	springboot
	0.0.1-SNAPSHOT
	jar
	
		org.springframework.boot
		spring-boot-starter-parent
		1.5.9.RELEASE
	
	springboot
	http://maven.apache.org

	
		UTF-8
	

	
		
			junit
			junit
			3.8.1
			test
		
		
			org.springframework.boot
			spring-boot-starter-web
		
	


接下来就是启动类了,在App.java文件中添加如下代码

package com.yl.springboot;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * 启动类
 * 
 * @author YL
 * @date 2018年11月23日下午10:45:03
 */
@SpringBootApplication
public class App {
	private static Logger logger = LoggerFactory.getLogger(App.class);

	public static void main(String[] args) {
		System.out.println("Hello World!");
		SpringApplication.run(App.class);
		logger.info("启动成功!");
	}
}

启动这个类,当看到日志中输出了启动成功后则代表springboot配置成功。。。

。。。我写的啥啊

你可能感兴趣的:(Eclipse搭建springboot)