Spring Boot 配置 IDEA和DevTools 热部署的方法
MAVEN配置
4.0.0 cn.globalrave bar-web 0.0.1-SNAPSHOT jar bar-web BarprojectforSpringBoot org.springframework.boot spring-boot-starter-parent 1.5.6.RELEASE UTF-8 UTF-8 1.8 com.github.sd4324530 fastweixin 1.3.15 mysql mysql-connector-java org.mybatis.spring.boot mybatis-spring-boot-starter 1.3.0 org.springframework.boot spring-boot-starter-aop org.springframework.boot spring-boot-starter-cache org.springframework.boot spring-boot-starter-freemarker org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-websocket org.springframework.boot spring-boot-devtools runtime org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-maven-plugin true
IDEA配置
•CTRL+SHIFT+A查找勾选makeprojectautomatically选项
•ctrl+shift+alt+/查找Registry勾选compiler.automake.allow.when.app.running选项
DevTools配置
默认改变/META-INF/maven,/META-INF/resources,/resources,/static,/publicor/templates等目录文件,会重新重启项目,当然我们编辑静态文件不想重启项目可以配置
spring.devtools.restart.exclude=static/**,public/** #DEVTOOLS(DevToolsProperties) spring.devtools.livereload.enabled=true#Enablealivereload.comcompatibleserver. spring.devtools.livereload.port=35729#Serverport. spring.devtools.restart.additional-exclude=#Additionalpatternsthatshouldbeexcludedfromtriggeringafullrestart. spring.devtools.restart.additional-paths=#Additionalpathstowatchforchanges. spring.devtools.restart.enabled=true#Enableautomaticrestart. spring.devtools.restart.exclude=META-INF/maven/**,META-INF/resources/**,resources/**,static/**,public/**,templates/**,**/*Test.class,**/*Tests.class,git.properties#Patternsthatshouldbeexcludedfromtriggeringafullrestart. spring.devtools.restart.poll-interval=1000#Amountoftime(inmilliseconds)towaitbetweenpollingforclasspathchanges. spring.devtools.restart.quiet-period=400#Amountofquiettime(inmilliseconds)requiredwithoutanyclasspathchangesbeforearestartistriggered. spring.devtools.restart.trigger-file=#Nameofaspecificfilethatwhenchangedwilltriggertherestartcheck.Ifnotspecifiedanyclasspathfilechangewilltriggertherestart. #REMOTEDEVTOOLS(RemoteDevToolsProperties) spring.devtools.remote.context-path=/.~~spring-boot!~#Contextpathusedtohandletheremoteconnection. spring.devtools.remote.debug.enabled=true#Enableremotedebugsupport. spring.devtools.remote.debug.local-port=8000#Localremotedebugserverport. spring.devtools.remote.proxy.host=#Thehostoftheproxytousetoconnecttotheremoteapplication. spring.devtools.remote.proxy.port=#Theportoftheproxytousetoconnecttotheremoteapplication. spring.devtools.remote.restart.enabled=true#Enableremoterestart. spring.devtools.remote.secret=#Asharedsecretrequiredtoestablishaconnection(requiredtoenableremotesupport). spring.devtools.remote.secret-header-name=X-AUTH-TOKEN#HTTPheaderusedtotransferthesharedsecret.
总结
以上所述是小编给大家介绍的SpringBoot配置IDEA和DevTools热部署的方法,希望对大家有所帮助,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的!