使用IDEA 创建SpringBoot项目

首先File ->New -> project ->Spring Initializr ->next

如果没有Spring Initializr   选择右下角config ->setting  搜索Springboot 勾选  然后apply ok

 

第二步:

在项目中写上自己需要的名称 type 选择 maven project ->next

 

第三步:

 

 选择sql

 

nosql 然后一路next  finsh 结束

 

 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 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.cedar.star</groupId><artifactId>demo</artifactId><version>0.0.1-SNAPSHOT</version><packaging>jar</packaging><name>scm</name><description>scm project for Spring Boot</description><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.0.4.RELEASE</version><relativePath/> <!-- lookup parent from repository --></parent><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><java.version>1.8</java.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-amqp</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-batch</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-jpa</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jdbc</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-mail</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-quartz</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>1.3.2</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><scope>runtime</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.springframework.batch</groupId><artifactId>spring-batch-test</artifactId><scope>test</scope></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build></project>

 

 写一个测试demo 看看效果:

配置端口:

 

package com.cedar.demo;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
@SpringBootApplication
public class index {@RequestMapping("/")String index() {return "Hello Spring Boot";}public static void main(String[] args) {SpringApplication.run(index.class, args);}
}

  

启动项目

结果:

 

转载于:https://www.cnblogs.com/xiaosisong/p/9507041.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/413491.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

工作335:uni-ele-el-date-picker限制选择时间

<el-form-item :label"index 1 .发布时间"><el-date-picker v-model"task.start_time" :picker-options"pickerOptions" :disabled"viewMode"/></el-form-item>pickerOptions: {disabledDate(time) {return time…

PhantomJS 一个隐形的浏览器

下载地址: http://phantomjs.org/download.html 使用方法: 下载压缩包解压出来找到phantomjs.exe 放到python的根目录下 转载于:https://www.cnblogs.com/kaibindirver/p/9509684.html

Vue介绍-Vue简单应用-Vue基本用法

什么是Vue&#xff1f;1、Vue.js&#xff08;读音 /vjuː/, 类似于 view&#xff09; 是一套构建用户界面的渐进式框架。2、Vue 只关注视图层&#xff0c; 采用自底向上增量开发的设计。3、Vue 的目标是通过尽可能简单的 API 实现响应的数据绑定和组合的视图组件。Vue可以用来做…

[css] 你们团队中css的class命名采用的是什么方式呢?下划线还是横线还是驼峰?

[css] 你们团队中css的class命名采用的是什么方式呢&#xff1f;下划线还是横线还是驼峰&#xff1f; 形式 .a .a-b不用驼峰和_&#xff0c;因为这两样都需要 shift 辅助输入, 驼峰越多&#xff0c;按下shift 键的次数就越多。个人简介 我是歌谣&#xff0c;欢迎和大家一起交…

[css] 一个项目中有很多无用的css代码,怎么找到并清除这些无用的代码?

[css] 一个项目中有很多无用的css代码&#xff0c;怎么找到并清除这些无用的代码&#xff1f; 1.使用浏览器插件 2.使用PurifyCSS 3.chrome浏览器 F12审查元素的Audits&#xff0c;手动删个人简介 我是歌谣&#xff0c;欢迎和大家一起交流前后端知识。放弃很容易&#xff0c;…

Mysql:替换某个字段中的部分字符串——replace函数

需求&#xff1a;因同事操作不当&#xff0c;使某个字段出现了不必要的字符串&#xff0c;导致数据无法正常解析&#xff0c;需要将该字符串统一去掉。

线段树、树状数组

A 树状数组:1 #include<iostream>2 #include<cstdio>3 #include<algorithm>4 #include <string.h>5 using namespace std;6 // 1h / 10min7 const int maxn 32001;8 int c[maxn],ans[maxn]; // c[i] : 以i为横坐标的星星左侧和下侧星星的个数&#xf…

[css] 怎么给手持设备添加特殊样式?

[css] 怎么给手持设备添加特殊样式&#xff1f; -webkit-touch-callout:none ---------- 禁止长按弹出菜单个人简介 我是歌谣&#xff0c;欢迎和大家一起交流前后端知识。放弃很容易&#xff0c; 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌谣一起通关前端面试题

{ parser: babylon } is deprecated; we now treat it as { parser: babel }.

npm run dev 错误提示&#xff1a; { parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }. 治标的解决方法&#xff1a; 找到你的工程文件夹里的 YourProName\node_modules\vue-loader\lib\template-compiler\index.js //将以…

[css] 写出在不固定宽高的元素在固定高度的情况下水平垂直居中的方法

[css] 写出在不固定宽高的元素在固定高度的情况下水平垂直居中的方法 flex布局&#xff1b;还有就是可以用定位也可以实现等等&#xff1b; flex&#xff1a;父div&#xff1a;&#xff5b;display&#xff1a;flex&#xff1b; justify-content: center;align-items: center;…

npm WARN build `npm build` called with no arguments. Did you mean to `npm run-script build`

跑npm build结果如下&#xff1a; npm WARN build npm build called with no arguments. Did you mean to npm run-script build 把指令改成 npm run build 即可

Android内容提供器——运行权限

程序运行是的权限分为两种&#xff0c;一种是普通权限&#xff0c;一种是危险权限。普通权限的话可以直接使用&#xff0c;只有危险权限需要询问用户的同意。 危险权限分组以及组内权限如下&#xff1a; 注&#xff1a;危险权限同一组内有一项权限被授权&#xff0c;则一组权限…

[css] CSS content属性特殊字符有哪些?

[css] CSS content属性特殊字符有哪些&#xff1f; 今天在做开发的时候&#xff0c;需要用到CSS的content属性&#xff0c;加入一些特殊字符来实现网页效果。但是特殊字符那么多&#xff0c;怎么可能记得住&#xff0c;所以谷歌百度搜索之后找到了一个比较全的&#xff0c;在这…

json-server的使用

这里跳过node安装以及npm安装 先全局安装&#xff1a;npm install json-server -g在桌面创建一个空的文件夹JSONSERVERcd 进入到这个文件夹执行npm init --yes&#xff0c;这时候文件夹会多出一个package.json的文件项目再安装一次&#xff1a;npm install json-server --sav…

Eclipse 使用 CodeMix 插件 开发 Vue.js

前言&#xff1a;对比vscode&#xff0c; codemix集成在eclipse插件里面&#xff0c;符合使用习惯 1、下载并安装node.js 官网地址&#xff1a; https://nodejs.org/en/ &#xff0c; 当前版本是 node-v8.11.4-x64.msi&#xff0c; 安装过程直接默认选项即可。 安装完成后&…

用css画出一个圆圈,里面有个叉号(不能用英文字母x)

用css画出一个圆圈&#xff0c;里面有个叉号&#xff08;不能用英文字母x&#xff09; #cyc {width: 150px;height: 150px;margin: 100px auto;border-radius: 50%;border: 5px solid #000000;position: relative;}#cyc::before {content: "";display: block;width:…

开发模式下浏览器不支持ES6

在工程项目下安装babel: cnpm install babel-preset-stage-2 --sava-dev 然后在工程项目下找到.babelrc文件打开并在这个位置添加这个参数&#xff0c;如下图 最后&#xff0c;cnpm run dev重启一下项目即可

[css] 用css画出一个圆圈,里面有个对号

[css] 用css画出一个圆圈&#xff0c;里面有个对号 #right {width: 150px;height: 150px;margin: 100px auto;border-radius: 50%;border: 5px solid #000000;display: flex;justify-content: center;align-items: center;}#right::before {content: "";display: bl…

vue项目打包成APP

点击查看转载源 事先准备&#xff0c;开发完成的web app项目&#xff08;也可以利用vue-cli脚手架构建vue模板项目&#xff09;&#xff0c;npm run dev可以正常预览的项目 1&#xff0c;将项目目录下config文件内index.js中assetsPublicPath修改为 assetsPublicPath: ./ 2&…

[css] 如何解决html设置height:100%无效的问题?

[css] 如何解决html设置height&#xff1a;100%无效的问题&#xff1f; 在外层包一个给定高度的 div个人简介 我是歌谣&#xff0c;欢迎和大家一起交流前后端知识。放弃很容易&#xff0c; 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌谣一起通关前端面试题