Maven构建SpringBoot项目
来源:互联网 发布:店面招牌设计软件 编辑:程序博客网 时间:2024/05/18 03:06
注意点:
1、生成的应用位置应该放在groupId的文件夹下面
目的:
构建一个Spring Boot项目,并实现一个简单的Http请求处理了解Spring Boot项目创建,运行过程,项目结构,简单、开发快速的特性
Spring Boot 的优点:
1,开发者快速入门2,开箱即用(自带各种默认配置,简化项目配置项)3,无冗余代码生成和XML配置文件
创建SpringBoot项目
访问:http://start.spring.io/ , 通过SPRING INITIALIZR工具生成基础项目
查看项目
使用idea,导入Maven项目,项目结构如下:
引入Web模块
新建工程的pom.xml,引入了2个依赖模块
spring-boot-starter:核心模块,包括自动配置支持、日志和YAML
spring-boot-starter-test:测试模块,包括JUnit、Hamcrest、Mockito
需要引入Web模块 : pring-boot-starter-web
<dependencies> <!-- 核心模块,包括自动配置支持、日志和YAML --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <!-- 测试模块,包括JUnit、Hamcrest、Mockito --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <!-- 引入Web模块 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency></dependencies>
添加HelloWord服务
启动主程序
打开浏览器访问http://localhost:8080/hello,页面输出Hello World
Web项目创建完成
阅读全文
0 0
- Maven构建SpringBoot项目
- Maven构建SpringBoot项目
- springboot+maven快速构建项目
- springBoot maven快速构建项目
- docker 构建springboot maven 项目
- Jenkins+github+maven自动构建发布SpringBoot项目
- springboot(二)项目构建
- springboot构建项目
- 构建一个Springboot项目
- SpringBoot Maven构建工具插件
- Maven构建springBoot Demo案例
- maven项目springboot出问题
- 【Maven】maven 项目构建
- [SpringBoot]构建SpringBoot项目 By Eclipse
- IDEA里构建SpringBoot项目
- 2.SpringBoot构建项目解析
- Spring Boot (一) maven构建springboot初探
- 构建Springboot 1.5.1 Maven工程
- zabbix+httpd访问时报403
- Linux下彻底卸载mysql详解
- java实现简单的学生信息管理系统
- 日常2.1--关于EasyUI的坑(datagrid_2)
- on条件与where条件的区别
- Maven构建SpringBoot项目
- 惭愧呀!工作这么多年了,才知道“性能优化”是这么一回事!
- linux内核启动流程及busybox分析
- Android进程间通信(IPC)机制Binder简要介绍和学习计划
- canvas简单的粒子效果的实现
- SpringBoot集成jsp
- 代数方程解的存在性和唯一性(if and only if)
- windows 下虚拟机安装mac os
- 响应式表格