Spring Boot 配置 IDEA和DevTools 热部署的方法

这篇文章主要介绍了Spring Boot 配置 IDEA和DevTools 热部署的方法,需要的朋友可以参考下

MAVEN 配置

   4.0.0cn.globalravebar-web0.0.1-SNAPSHOTjarbar-webBar project for Spring Boot org.springframework.bootspring-boot-starter-parent1.5.6.RELEASE UTF-8UTF-81.8  com.github.sd4324530fastweixin1.3.15 mysqlmysql-connector-java org.mybatis.spring.bootmybatis-spring-boot-starter1.3.0 org.springframework.bootspring-boot-starter-aop org.springframework.bootspring-boot-starter-cache org.springframework.bootspring-boot-starter-freemarker org.springframework.bootspring-boot-starter-web org.springframework.bootspring-boot-starter-websocket org.springframework.bootspring-boot-devtoolsruntime org.springframework.bootspring-boot-starter-testtest   org.springframework.bootspring-boot-maven-plugin true

 IDEA 配置

•CTRL + SHIFT + A 查找 勾选 make project automatically 选项

•ctrl+shift+alt+/ 查找Registry 勾选 compiler.automake.allow.when.app.running 选项

DevTools 配置

默认改变 /META-INF/maven, /META-INF/resources, /resources, /static, /public or /templates 等目录文件,会重新重启项目,当然我们编辑静态文件不想重启项目可以配置

 spring.devtools.restart.exclude=static/**,public/** # DEVTOOLS (DevToolsProperties) spring.devtools.livereload.enabled=true # Enable a livereload.com compatible server. spring.devtools.livereload.port=35729 # Server port. spring.devtools.restart.additional-exclude= # Additional patterns that should be excluded from triggering a full restart. spring.devtools.restart.additional-paths= # Additional paths to watch for changes. spring.devtools.restart.enabled=true # Enable automatic restart. spring.devtools.restart.exclude=META-INF/maven/**,META-INF/resources/**,resources/**,static/**,public/**,templates/**,**/*Test.class,**/*Tests.class,git.properties # Patterns that should be excluded from triggering a full restart. spring.devtools.restart.poll-interval=1000 # Amount of time (in milliseconds) to wait between polling for classpath changes. spring.devtools.restart.quiet-period=400 # Amount of quiet time (in milliseconds) required without any classpath changes before a restart is triggered. spring.devtools.restart.trigger-file= # Name of a specific file that when changed will trigger the restart check. If not specified any classpath file change will trigger the restart. # REMOTE DEVTOOLS (RemoteDevToolsProperties) spring.devtools.remote.context-path=/.~~spring-boot!~ # Context path used to handle the remote connection. spring.devtools.remote.debug.enabled=true # Enable remote debug support. spring.devtools.remote.debug.local-port=8000 # Local remote debug server port. spring.devtools.remote.proxy.host= # The host of the proxy to use to connect to the remote application. spring.devtools.remote.proxy.port= # The port of the proxy to use to connect to the remote application. spring.devtools.remote.restart.enabled=true # Enable remote restart. spring.devtools.remote.secret= # A shared secret required to establish a connection (required to enable remote support). spring.devtools.remote.secret-header-name=X-AUTH-TOKEN # HTTP header used to transfer the shared secret.

总结

以上所述是小编给大家介绍的Spring Boot 配置 IDEA和DevTools 热部署的方法,希望对大家有所帮助,如果大家 有任何疑问欢迎给我留言,小编会及时回复大家的!

以上就是Spring Boot 配置 IDEA和DevTools 热部署的方法的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » Java