Search in sources :

Example 1 with WebServerPortFileWriter

use of org.springframework.boot.web.context.WebServerPortFileWriter in project spring-boot by spring-projects.

the class ResourceHandlingApplication method main.

public static void main(String[] args) {
    try {
        Class.forName("org.springframework.web.servlet.DispatcherServlet");
        System.err.println("Spring MVC must not be present, otherwise its static resource handling " + "will be used rather than the embedded containers'");
        System.exit(1);
    } catch (Throwable ex) {
        new SpringApplicationBuilder(ResourceHandlingApplication.class).properties("server.port:0").listeners(new WebServerPortFileWriter(args[0])).run(args);
    }
}
Also used : WebServerPortFileWriter(org.springframework.boot.web.context.WebServerPortFileWriter) SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder)

Aggregations

SpringApplicationBuilder (org.springframework.boot.builder.SpringApplicationBuilder)1 WebServerPortFileWriter (org.springframework.boot.web.context.WebServerPortFileWriter)1