简单回答:兼容,而且这是非常常见、官方推荐的组合。
下面分几点说明:
Swagger(现在一般说 Springdoc OpenAPI 或 Springfox)对 Spring 支持很好:
springfox-swagger2springdoc-openapi-ui(推荐)示例(Spring Boot 3 + springdoc):
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.3.0</version>
</dependency>
启动后访问:
http://服务器IP:端口/swagger-ui.html
在 Linux 上:
java -jar your-app.jar
server.address=0.0.0.0/swagger-ui/** 转发✅ Linux 完全兼容 Spring
✅ Swagger 完全兼容 Spring
✅ Linux + Spring Boot + Swagger 是生产级标准方案
如果你有:
我可以给你更具体的配置示例。