Spring boot 下 Knife4j 的使用
Knife4j · 集 Swagger2 及 OpenAPI3 为一体的增强解决方案. | Knife4j
https://doc.xiaominfo.com/
knife4j: knife4j 是为 Java MVC 框架集成 Swagger 生成 Api 文档的工具,前身是 swagger-bootstrap-ui
https://gitee.com/xiaoym/knife4j
Knife4j · 集 Swagger2 及 OpenAPI3 为一体的增强解决方案. | Knife4j
https://doc.xiaominfo.com/
knife4j: knife4j 是为 Java MVC 框架集成 Swagger 生成 Api 文档的工具,前身是 swagger-bootstrap-ui
https://gitee.com/xiaoym/knife4j
For full documentation visit mkdocs.org.
mkdocs new [dir-name] - Create a new project.mkdocs serve - Start the live-reloading docs server.mkdocs build - Build the documentation site.mkdocs -h - Print help message and exit.mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
SPRING Environment 为此提供了一个 API,但是您通常会设置一个 System 属性(spring.profiles.active) 或者一个 OS 环境变量(SPRING_PROFILES_ACTIVE)。此外,您可以使用 -D 参数启动应用程序(记住将其放在 main 类或 jar 归档之前) ,如下所示:
1 | java -jar -Dspring.profiles.active=production demo-0.0.1-SNAPSHOT.jar |
或者
1 | java -jar demo-0.0.1-SNAPSHOT.jar --spring.profiles.active=production |
在 Spring Boot 中,您还可以在 application.properties 中设置 active profile ,如下面的示例所示:
可以是一个
1 | spring.profiles.active=production |
也可以是多个
1 | spring.profiles.active=dev,hsqldb |
或者使用 application.yml 形式
1 | spring: |
Spring Boot 2.3.12.RELEASE API 参考
Spring Boot 参考文档
https://docs.spring.io/spring-boot/docs/2.3.12.RELEASE/reference/html/