 <p><code>SpringApplication</code> has a property <code>webEnvironment</code>. It defaults to true if Tomcat is on the classpath but you can set it to false (programmatically or with <code>spring.main.webEnvironment</code>).</p>