Spring Boot Dev Tools Turning them off for production?

前端 未结 3 1179
难免孤独
难免孤独 2021-02-11 19:44

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:52

    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

提交回复
热议问题