@Bean
public JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory(@Value("${server.port:8080}") final String port) {
final JettyEmbeddedServletContainerFactory factory = new JettyEmbeddedServletContainerFactory(Integer.valueOf(port));
factory.addServerCustomizers(new JettyServerCustomizer() {
@Override
public void customize(final Server server) {
// Expose Jetty managed beans to the JMX platform server provided by Spring
final MBeanContainer mbContainer = new MBeanContainer(ManagementFactory.getPlatformMBeanServer());
server.addBean(mbContainer);
}
});
return factory;
}