Question: I have a simple Spring Boot application that gets messages from a JMS queue and saves some data to a log file, but does not need a web server. Is there any way of starting Spring Boot without the web server?

Answer: 
if you want to run **Spring Boot 1.x** without a servlet container, but with one on the classpath (e.g. for tests), use the following, as described in the [spring boot documentation](https://docs.spring.io/spring-boot/docs/1.5.x/reference/htmlsingle/#boot-features-web-environment):

```
@Configuration
@EnableAutoConfiguration
public class MyClass {
    public static void main(String[] args) throws JAXBException {
         SpringApplication app = new SpringApplication(MyClass.class);
         app.setWebEnvironment(false); //<<<<<<<<<
         ConfigurableApplicationContext ctx = app.run(args);
    }
}

```

also, I just stumbled across this property:

```
spring.main.web-environment=false

```
Spring boot will not include embedded tomcat if you don't have Tomcat dependencies on the classpath.
You can view this fact yourself at the class `EmbeddedServletContainerAutoConfiguration` whose source you can find [here](https://github.com/spring-projects/spring-boot/blob/v1.1.7.RELEASE/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java).

The meat of the code is the use of the `@ConditionalOnClass` annotation on the class `EmbeddedTomcat`

---

Also, for more information check out [this](http://spring.io/blog/2014/03/07/deploying-spring-boot-applications) and [this](http://spring.io/guides/gs/convert-jar-to-war-maven/) guide and [this](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#build-tool-plugins-maven-packaging) part of the documentation