pdf文档 Spring Boot 2.2.0.M6 Reference Documentation

12.25 MB 518 页 0 评论
语言 格式 评分
英语
.pdf
3
摘要
The document is the reference guide for Spring Boot 2.2.0.M6. It covers various topics including getting started with Spring Boot, system requirements, build tool plugins for Maven and Gradle, production-ready features via Spring Boot Actuator, and customizable starters for specific technologies. The guide also provides installation instructions for the Spring CLI and details on configuring embedded servlet containers such as Tomcat and Jetty.
AI总结
以下是对《Spring Boot 2.2.0.M6 Reference Documentation》的中文总结,语言简洁明了,重点突出核心观点和关键信息: --- ### 1. 文档概览 - Spring Boot 参考文档提供了多种格式:多页 HTML、单页 HTML 和 PDF。 - 最新版本可从 [docs.spring.io](https://docs.spring.io/spring-boot/docs/current/reference) 获取。 - 文档包含版权声明,允许免费复制和分发,前提是保留版权信息。 #### 1.1. 获取帮助 - 常见问题解决方案可参考 How-to 文档。 - 学习 Spring 基础知识,Spring Boot 构建于其他 Spring 项目之上。 - 在 stackoverflow.com 提问时标记 `spring-boot`。 - 在 GitHub-issue 跟踪 Spring Boot 的 bug。 - Spring Boot 及其文档均为开源,可参与改进。 #### 1.2. 快速入门 - 初学者从基础开始:概述、要求、安装。 - 教程分两部分,运行示例分两部分。 #### 1.3. 使用 Spring Boot - 使用构建工具插件(Maven 和 Gradle)。 - 参考附录:应用属性、自动配置类和可执行 JAR。 --- ### 2. Spring Boot 简介 - Spring Boot 使创建独立的、生产级 Spring 应用变得简单。 - 提供对 Spring 平台和第三方库的 opinionated 视图。 - 支持 Java 应用,可通过 `java -jar` 或传统 WAR 部署。 - 提供命令行工具运行 Spring 脚本。 - 核心目标: - 提供快速上手体验。 - 默认配置即用,同时支持快速调整。 - 提供非功能性特性(嵌入式服务器、安全性、指标收集等)。 - 无需代码生成和 XML 配置。 #### 2.1. 系统要求 - 需 Java 8,支持至 Java 12。 - Spring Framework 5.2.0.RC2 或以上版本。 - 支持 Maven 3.3+ 和 Gradle 5.x(4.10 也支持但已弃用)。 - 支持的嵌入式 Servlet 容器:Tomcat、Jetty、Undertow。 #### 2.2. 安装 Spring CLI - 下载istributions:`spring-boot-cli-2.2.0.M6-bin.zip` 或 `tar.gz`。 - 使用 SDKMAN 安装:`sdk install springboot`。 - 开发者可使用本地构建:`sdk install springboot dev`。 --- ### 3. 构建工具插件 Spring Boot 提供 Maven 和 Gradle 插件,支持生成可执行 JAR/WAR 和其他扩展功能。 #### Maven 插件 - 配置示例: ```xml org.springframework.boot spring-boot-maven-plugin 2.2.0.M6 repackage ``` - 支持生成构建信息和 Git 信息。 #### Gradle 插件 - 配置示例: ```groovy springBoot { buildInfo() } ``` - 支持生成构建信息和 Git 信息。 --- ### 4. 生产就绪特性 - 通过 `spring-boot-actuator` 提供监控和管理功能。 - 主要特性: - **端点(Endpoints)**:监控和交互应用,如健康检查。 - **启用功能**:通过 Maven 或 Gradle 添加依赖。 - ** audits, health, metrics**:自动应用 аудит、健康和指标收集。 --- ### 5. 应用结构与代码布局 - **代码结构**: - 推荐使用反转域名命名包(如 `com.example.project`),避免使用默认包。 - 主应用类应位于根包,方便扫描组件。 - **启动类**:`@SpringBootApplication` 扫描组件、配置属性和实体。 - **技术 starter**:如 `spring-boot-starter-web`、`spring-boot-starter-tomcat` 等。 --- ### 6. CLI 扩展 - 支持通过 `spring install` 和 `spring uninstall` 管理扩展。 - 示例: ```bash spring install com.example:spring-boot-cli-extension:1.0.0.RELEASE spring uninstall com.example:spring-boot-cli-extension:1.0.0.RELEASE ``` --- ### 总结 该文档全面介绍了 Spring Boot 2.2.0.M6 的核心功能、安装使用、构建工具插件以及生产就绪特性,提供了详细的配置示例和最佳实践,适合开发者快速上手和深入使用 Spring Boot。
P1
P2
P3
P4
P5
P6
P7
下载文档到本地,方便使用
- 可预览页数已用完,剩余 511 页请下载阅读 -
文档评分
请文明评论,理性发言.