1.创建一个简单的maven project项目

2.项目目录结构

**注意启动类的位置:

3.pom.xml 配置jar包

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath/>
</parent> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>

4、创建一个SpringBoot项目运行的启动类

package com.lxp.Application;

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

5、创建一个controller(@Controller只返回页面;@RestController返回json格式的数据)

package com.lxp.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; @RestController
public class HelloWordController { @RequestMapping("hello")
public String hello() { return "HelloWord";
} }

6.查看效果

Meaven搭建springboot项目的更多相关文章

  1. 在线官网Spring Initializr 或 IntelliJ IDEA 快速搭建springboot项目

    Spring Boot是由Pivotal团队提供的全新框架,设计目的是用来简化新Spring应用的初始搭建以及开发过程.它主要推崇的是'消灭配置’,实现零配置. 那么,如何快速新建一个一个spring ...

  2. SpringBoot从入门到精通一(idea优雅搭建SpringBoot项目)

    前言 在没有SpringBoot之前,我们搭建的是SSM(SpingMVC+Spring+Mybatis)项目,在搭建SSM项目的时候,我们要经过一系列的繁琐配置,例如:application,web ...

  3. 小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_2-2.快速搭建SpringBoot项目,采用IDEA

    笔记 2.快速搭建SpringBoot项目,采用IDEA     简介:使用SpringBoot start在线生成项目基本框架并导入到IDEA中 参考资料:         IDEA使用文档    ...

  4. 小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_2-1.快速搭建SpringBoot项目,采用Eclipse

    笔记 1.快速搭建SpringBoot项目,采用Eclipse     简介:使用SpringBoot start在线生成项目基本框架并导入到eclipse中 1.站点地址:http://start. ...

  5. idea:spring initializr无web勾选,maven方式搭建springboot项目。jdk7创建springboot项目的版本不兼容问题。

    一.idea 使用spring initializr不选择web搭建springboot项目 1.file => new => project 2.直接next到finish结束. 3.完 ...

  6. 使用IDEA快速搭建Springboot项目

    Spring Boot是由Pivotal团队提供的全新框架,设计目的是用来简化新Spring应用的初始搭建以及开发过程.它主要推崇的是'消灭配置’,实现零配置. 下面就介绍一下如何使用idea快速搭建 ...

  7. 搭建 SpringBoot 项目(前端页面 + 数据库 + 实现源码)

    SpringBoot 项目整合源码 SpringBoot 项目整合 一.项目准备 1.1 快速创建 SpringBoot 项目 1.2 项目结构图如下 1.3 数据表结构图如下 1.4 运行结果 二. ...

  8. idea快速搭建springboot项目

    Spring Boot是由Pivotal团队提供的全新框架,设计目的是用来简化新Spring应用的初始搭建以及开发过程.它主要推崇的是'消灭配置',实现零配置. 那么,如何在idea中创建一个spri ...

  9. STS搭建SpringBoot项目

    开发工具:推荐IDEA . Spring Tool Suit 虽然很简单,但还是记录一下,图个热闹. 开始 >>> 1. File --> New --> Spring ...

随机推荐

  1. CentOS 7 下挂载NTFS盘及开机自动挂载

    一.工具 NTFS-3G 二.安装2种安装方式 2.1.yum安装 yum install NTFS* 2.2.编译安装 下载 解压 wget https://tuxera.com/opensourc ...

  2. ToolStripComboBox的DataSource和DataTable使用技巧

      可以使用Items属性private void GetData() //一下数据均为测试{toolStripComboBox1.Items.Clear();            DataTabl ...

  3. 吴裕雄 python 机器学习——集成学习AdaBoost算法分类模型

    import numpy as np import matplotlib.pyplot as plt from sklearn import datasets,ensemble from sklear ...

  4. 吴裕雄 python 机器学习——半监督学习LabelSpreading模型

    import numpy as np import matplotlib.pyplot as plt from sklearn import metrics from sklearn import d ...

  5. Vue集成openlayers

    1.安装ol库 使用cnpm i ol -s命令安装 2.建一个olMap.vue文件夹 <template> <div class='olMap'> <h2>{{ ...

  6. (爬虫)随机生成一个header

    #!/usr/bin/env python #-*- coding: utf-8 -*- #__Author__: yunrui #__Version__: 1.0 #__Time__: 2019/1 ...

  7. AI人工智能之基于OpenCV+face_recognition实现人脸识别

    因近期公司项目需求,需要从监控视频里识别出人脸信息.OpenCV非常庞大,其中官方提供的人脸模型分类器也可以满足基本的人脸识别,当然我们也可以训练自己的人脸模型数据,但是从精确度和专业程度上讲Open ...

  8. 6_9 天平(UVa839)<二叉树的DFS>

    前一个ubiquous通信小工具,移动只是一个由弦和电线组成的结构五彩缤纷的东西.这种移动通常被发现悬挂在小婴儿的摇篮.图说明了一个简单的移动.它只是一个电线,悬挂的一个字符串,每一个对象的对象.它可 ...

  9. static关键字 weak关键字

    1.static关键字 static HAL_StatusTypeDef UART_Receive_IT(UART_HandleTypeDef *huart){ ...} 在函数前面加了一个stati ...

  10. Win下PHP5.6版本安装redis扩展

    首先说一下自己的环境啥的,我用的是phpstudy,其实没啥大用,就是看你的php版本啥的 1.运行phpinfo(),查看php的信息,php的位数和扩展信息,和要下载的扩展文件信息有关, 2.下载 ...