Spring Boot Dev Tools Turning them off for production?

前端 未结 3 1176
Happy的楠姐
Happy的楠姐 2021-02-11 19:20

I was reading around a lot about spring dev tools and I have tried them on and they seem pretty cool. However, I don\'t understand how they get enabled / disabled. For instan

3条回答
  •  囚心锁ツ
    2021-02-11 19:50

    It is excluded automatically for Spring Boot applications that use the JAR packaging. However, for WAR packaged Spring Boot projects, it is not. For Maven Spring Boot projects you must mark the dependency as provided and also set excludeDevTools=true in your pom.xml.

    Change devtools to "provided"

    
        org.springframework.boot
        spring-boot-devtools
        provided
    
    

    Exclude devtools from maven spring build plugin

    
        org.springframework.boot
        spring-boot-maven-plugin
        
            true
        
    
    

    More information here: https://github.com/spring-projects/spring-boot/issues/7556

提交回复
热议问题