本地代码自动编译

This commit is contained in:
冯辉
2026-06-27 16:24:55 +08:00
parent ba2f73d3b8
commit 1647e0ce13
4 changed files with 105 additions and 1 deletions

View File

@@ -29,4 +29,4 @@ public class RuoYiApplication
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
}
}

View File

@@ -0,0 +1,24 @@
package com.ruoyi.web.core.config;
import org.apache.catalina.connector.Connector;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
/**
* DevTools 热重启配置 - 修复 Windows 下端口未释放问题
* 启用 SO_REUSEADDR允许 DevTools 重启时立即复用端口
* 仅在本地开发环境生效,不影响线上
*/
@Profile("local")
@Configuration
public class DevToolsConfig implements WebServerFactoryCustomizer<TomcatServletWebServerFactory> {
@Override
public void customize(TomcatServletWebServerFactory factory) {
factory.addConnectorCustomizers((Connector connector) -> {
connector.setProperty("socket.soReuseAddress", "true");
});
}
}

View File

@@ -2,6 +2,8 @@
server:
# 服务器的HTTP端口默认为8080
port: 9091
# 优雅关闭,防止 Windows 下 DevTools 重启时端口冲突
shutdown: graceful
servlet:
# 应用的访问路径
context-path: /
@@ -50,6 +52,11 @@ spring:
restart:
# 热部署开关
enabled: true
# 变更检测后的静默期ms给 IDE 编译留时间
quiet-period: 400
lifecycle:
# 优雅关闭超时
timeout-per-shutdown-phase: 10s
# redis 配置
# token配置
token: