Created
December 19, 2019 23:41
-
-
Save SimoneGianni/74b3b7e5f5986a72a95e705cc6abe6dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.catalina.Context; | |
import org.springframework.boot.web.embedded.tomcat.TomcatContextCustomizer; | |
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; | |
import org.springframework.boot.web.server.WebServerFactoryCustomizer; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; | |
@Configuration | |
public class TurnOffEmbeddedTomcatReload { | |
@Bean | |
public WebServerFactoryCustomizer<TomcatServletWebServerFactory> servletContainerCustomizer() { | |
return new WebServerFactoryCustomizer<TomcatServletWebServerFactory>() { | |
@Override | |
public void customize(TomcatServletWebServerFactory container) { | |
container.addContextCustomizers(new TomcatContextCustomizer() { | |
@Override | |
public void customize(Context cntxt) { | |
cntxt.setReloadable(false); | |
} | |
}); | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this save my life.