#Run #SpringBootApp #Jeety #UnderTow #Server
Description section don't allow lessThan and GreaterThan sign..So used brackets :::::
{dependency}
groupId}org.springframework.boot{/groupId}
{artifactId}spring-boot-starter-web{/artifactId}
{exclusions}
{exclusion}
{groupId}org.springframework.boot{/groupId}
{artifactId}spring-boot-starter-tomcat{/artifactId}
{/exclusion}
{/exclusions}
{/dependency}
{dependency}
{groupId}org.springframework.boot{/groupId}
{artifactId}spring-boot-starter-jetty{/artifactId}
{/dependency}
In gradle, able change can be achieved by this:
configurations {
compile.exclude module: "spring-boot-starter-tomcat"
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web:2.0.0.BUILD-SNAPSHOT")
compile("org.springframework.boot:spring-boot-starter-jetty:2.0.0.BUILD-SNAPSHOT")
}
Configure Jetty Options
To override, default jetty runtime configuration – you can configure them in application.properties file.
application.properties
server.port=8080
server.servlet.context-path=/home
####Jetty specific properties########
server.jetty.acceptors= # Number of acceptor threads to use.
server.jetty.max-http-post-size=0 # Maximum size in bytes of the HTTP post or put content.
server.jetty.selectors= # Number of selector threads to use.
Also, you may configure these options programatically using JettyEmbeddedServletContainerFactory bean.
@Bean
public JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory() {
JettyEmbeddedServletContainerFactory jettyContainer =
new JettyEmbeddedServletContainerFactory();
jettyContainer.setPort(9000);
jettyContainer.setContextPath("/home");
return jettyContainer;
}
![](https://i.ytimg.com/vi/BOUISRG7GsY/mqdefault.jpg)