目录树

  • 新建Maven项目及步骤
  • 修改方法
  • 启动测试

新建Maven项目及步骤

  我这里是从创建开始讲,使用的工具是Idea2017版本。如果是已经创建了Maven,想改为spring boot项目的请直接跳到【修改方法】

  1.点击右上角的File,出来的列表选择New Object:

  

  2.选择Maven,勾选Create from archetype,选择quickstart

  3.输入GroupId与ArtifactId,Version版本号自己看着怎么顺眼怎么改;其中GroupId为包名,ArtifactId是项目名;点击next

   4.选择Maven的配置,我这里是默认的,具体你也可以选择自己Maven的安装目录下的conf/setting.xml;点击next

  5.点击finished,完成Maven项目的创建


修改方法

  1.在pom.xml加入以下父依赖,用于指定spring-boot的版本;这个就类似于我们开发ssm中指定springframwork的版本号差不多。注:添加后请update下maven

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

  2.加入以下spring-boot依赖包

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

启动测试

  1.新建启动类,开启注解扫描

 package com.hdbs;

 import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; /**
* spring-boot startup
*
*/
@SpringBootApplication
public class ApplicationStartup
{
public static void main(String[] args) {
SpringApplication.run(ApplicationStartup.class, args);
}
}

  2.看到 start on port xxxx的字样表明启动成功

Maven项目改为spring boot项目的方法的更多相关文章

  1. IDEA通过Maven WebApp archetype 创建Spring boot项目骨架

    springboot项目资源: GitHub地址:https://github.com/TisFreedom/springbootdome.git 码云地址:https://gitee.com/Tis ...

  2. Spring Boot学习笔记:传统maven项目与采用spring boot项目区别

    项目结构区别 传统的maven构建的项目结构如下: 用maven构建的采用springboot项目结构如下: 二者结构一致,区别如下:传统项目如果需要打成war包,需要在WEB-INF目录结构配置we ...

  3. Spring框架学习笔记(6)——阿里云服务器部署Spring Boot项目(jar包)

    最近接外包,需要部署服务器,便是参考了网上的几篇博文,成功在阿里云服务器成功部署了Spring Boot项目,特记下本篇笔记 Spring Boot项目打包 这里说一下部署的一些问题 1.mysql驱 ...

  4. spring boot 之 如何创建spring boot项目

    创建spring boot的方式有非常多,今天我们使用maven来进行创建spring boot项目,因为maven使用的非常广泛,也很好用,很多IDE也都支持maven. 1 创建maven项目 1 ...

  5. Spring boot项目搭建及简单实例

    Spring boot项目搭建 Spring Boot 概述 Build Anything with Spring Boot:Spring Boot is the starting point for ...

  6. spring boot学习01【搭建环境、创建第一个spring boot项目】

    1.给eclipse安装spring boot插件 Eclipse中安装Spring工具套件(STS): Help -> Eclipse Marketplace... 在Search标签或者Po ...

  7. 只需两步!Eclipse+Maven快速构建第一个Spring Boot项目

     随着使用Spring进行开发的个人和企业越来越多,Spring从一个单一简介的框架变成了一个大而全的开源软件,最直观的变化就是Spring需要引入的配置也越来越多.配置繁琐,容易出错,让人无比头疼, ...

  8. Spring boot项目maven的profile多环境配置不自动替换变量的问题解决

    Spring boot项目maven的profile多环境配置不自动替换变量的问题解决   在网上找了好久,配置都很简单,可是我的程序就是不能自动替换变量,最终单独测试,发现原来是引用spring b ...

  9. maven 聚合工程 用spring boot 搭建 spring cloud 微服务 模块式开发项目

    项目的简单介绍: 项目采用maven聚合工程 用spring boot 搭建 spring cloud的微服务 模块式开发 项目的截图: 搭建开始: 能上图 我少打字 1.首先搭建maven的聚合工程 ...

随机推荐

  1. php编程--二叉树遍历算法实现

    今天使用php来实现二叉树的遍历 创建的二叉树如下图所示 php代码如下所示:   <?php   class Node {   public $value;   public $child_l ...

  2. C语言——顺序表插入、删除、定位运算算法

    说明:将元素x插入到顺序表L的第i个数据元素之前,这个i是从1开始的,但是程序中数组都是从0算起的,不要混淆了. 头文件: header.h // 顺序表的结构定义 #define Maxsize 1 ...

  3. C语言转置矩阵算法

    对一个nxn阶的矩阵进行转置,算法如下: #include <stdio.h> #define n 3 void MM(int a[][n]) { int i,j,temp; ;i < ...

  4. nyist 20 吝啬的国度(dfs)

    吝啬的国度 题目描述: 在一个吝啬的国度里有N个城市,这N个城市间只有N-1条路把这个N个城市连接起来. 现在,Tom在第S号城市,他有张该国地图,他想知道如果自己要去参观第T号城市, 必须经过的前一 ...

  5. C中atoi和strcpy的自定义实现

    这是两道经常考到的笔试题,看似简单的实现,其实专注到细节,还是有很多需要注意扣分的地方. atoi实现: #include <iostream> #include<ctype.h&g ...

  6. CSS浮动并清除浮动(造成的影响)

    一.浮动 CSS浮动    CSS float浮动的深入研究.详解及拓展(一)    CSS浮动属性Float详解 块级元素独占一行 块级元素,在页面中独占一行,自上而下排列,也就是传说中的流. 可以 ...

  7. .NET ->> 分享一个字符串模糊匹配指数的方法

    链接: http://www.tsjensen.com/blog/post/2011/05/27/Four+Functions+For+Finding+Fuzzy+String+Matches+In+ ...

  8. 测试mysql性能工具

    mysqlslap mysqlslap可以模拟服务器的负载,并输出计时信息.它包含在MySQL 5.1 的发行包中,应该在MySQL 4.1或者更新的版本中都可以使用.测试时可以执行并发连接数,并指定 ...

  9. 【Leetcode】【Medium】Letter Combinations of a Phone Number

    Given a digit string, return all possible letter combinations that the number could represent. A map ...

  10. Vim中增加ga键的vmap功能

    ga是Vim自带的显示光标字符编码的功能,但是反过来,没有从编码显示对应字符的功能. 因为编码是多位数,所以可视模式下写了此功能. 规则: 纯数字认为是10进制 其他情况都认为是16进制 纯数字的话, ...