【SpringBoot】SampleApplication最简单的Spring Boot创建;
来源:互联网 发布:巴洛特利废了知乎 编辑:程序博客网 时间:2024/06/05 07:40
原文链接地址:https://projects.spring.io/spring-boot/
Spring Boot
Takes an opinionated view of building production-ready Spring applications. Spring Boot favors convention over configuration and is designed to get you up and running as quickly as possible.
简单粗暴建立批量应用程序。Spring Boot喜欢配置文件,被设计于让你轻松,并且尽可能最快速启动(程序);
Features
- Create stand-alone Spring applications(创建独立的Spring程序)
- Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)(内嵌Tomcat,Jetty 或Undertow,不需要配置WAR包)
- Provide opinionated 'starter' POMs to simplify your Maven configuration(提供残暴的‘开始器’——POM来简化你的Maven配置)
- Automatically configure Spring whenever possible(如有需要,则自动配置Spring文件)
- Provide production-ready features such as metrics, health checks and externalized configuration(提供批量的特点,例如韵律学,健康监测和配置具象化)
- Absolutely no code generation and no requirement for XML configuration(绝对的无码和不需要XML配置文件)
Quick Start
The recommended way to get started using spring-boot in your project is with a dependency management system – the snippet below can be copied and pasted into your build. Need help? See our getting started guides on building with Maven and Gradle.
我们建议你在你的工程(project)中,依赖一些管理系统来开始使用Spring Boot,你可以在你的工程中复制下面的代码,如果你需要帮助,可以参考我们Maven或Gradle的开始操作指导;
在这个地方,你要选择下载的版本,是1.5.3还是其他的版本;
然后,还有一个要选择的就是使用Maven还是Gradle来管理你的依赖架包;
我下面的案例使用的是Maven 来管理我的Jar包;
这里有一个快速开始,在自己的IDEA中创建一个Maven项目,然后复制上面的代码。
然后,Maven就在后台开始下载jar包了;
因为Maven的jar包还没有下完,所以我的@Controller是红色的;
等我Maven下载完,resolve完必要的jar包,导包之后,@Controller就变正常了(黄色);
但是等我一运行,发现报错了;
报错原因很简单:
Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
不能够开始内置的WebApplicationContext,因为丢失了EmbededServletContainerFactory bean;因为EnableAutoConfiguration注释掉了,重新恢复成黄色注释就可以了;
之后导包就可以了;
控制台:
成功~
Spring Boot CLI(Spring Boot命令行界面)
Spring Boot ships with a command line tool that can be used if you want to quickly prototype with Spring. It allows you to run Groovy scripts, which means that you have a familiar Java-like syntax, without so much boilerplate code. Follow the instructions in our main documentation if you want to install the Spring Boot CLI.
如果你想快速使用Spring,你可以使用Spirng Boot的命令行工具。它允许你运行Groovy脚本,这意味着你会很熟悉Java一样的语法规则。没有太多的 样板代码。如果你想安装Spring Boot CLI,那就跟随你主文件的说明去操作;
- 【SpringBoot】SampleApplication最简单的Spring Boot创建;
- 使用Gradle创建一个最简单的Spring Boot项目
- 使用Gradle创建一个最简单的Spring Boot项目
- 使用Gradle创建一个最简单的Spring Boot项目
- Spring Boot 入门 (一)——建一个最简单的springboot项目
- Spring boot + elasticsearch的最简单实践
- Spring Boot 实现最简单的 Security
- 创建一个简单的Spring Boot项目
- springboot学习1-使用 Spring Starter Project快速创建基于spring-boot的web项目
- 简单创建spring boot 项目。
- Spring Boot(1),从最简单的开始
- 最简单的spring boot集成mybatis配置
- Springboot-启动 Spring Boot服务的方式
- SpringBoot:Spring Boot使用自定义的properties
- 利用Maven快速创建一个简单的spring boot 实例
- 4. Spring Boot 创建简单的web应用程序
- 利用Spring boot如何创建简单的web交互应用
- 极其简单的 使用IDEA 中 实现springboot 热部署 (spring boot devtools版)
- linux命令
- android退出动画失效问题
- Mybatis 用到的设计模式
- java、android可用的rtp封包解包h264
- Oracle创建序列,删除序列
- 【SpringBoot】SampleApplication最简单的Spring Boot创建;
- Laravel-mix及模板调用问题
- LeetCode 575. Distribute Candies
- 利用R语言分析挖掘Titanic数据集(三)
- 采购单
- Android多进程Process开发总结-优点与缺陷
- STL中const迭代器与const_iterator区别
- 从包中构建瓦片服务器
- Dubbo 设计模式