title: Excluding Tomcat dependencies from Spring Boot in Gradle
body: <p>I'm using Spring Boot with Jetty and it seems I cannot exclude all the Tomcat dependencies in my Gradle build file.</p>
  
  <p>Relevant part of build.gradle:</p>
  
  <pre><code>compile("org.springframework.boot:spring-boot-starter") {
      exclude module: "tomcat-embed-el"
  }
  compile("org.springframework.boot:spring-boot-starter-jetty")
  
  compile("org.springframework.boot:spring-boot-starter-web") {
      exclude module: "spring-boot-starter-tomcat"
  }
  </code></pre>
  
  <p>Yet when I run <code>gradle dependencies</code> parts of tomcat are still there, and causing issues with WebSockets:</p>
  
  <pre><code>...
  |    
  +--- org.springframework.boot:spring-boot-starter-web: -&gt; 1.4.1.RELEASE
  |    +--- org.springframework.boot:spring-boot-starter:1.4.1.RELEASE (*)
  |    +--- org.hibernate:hibernate-validator:5.2.4.Final
  |    |    +--- javax.validation:validation-api:1.1.0.Final
  |    |    +--- org.jboss.logging:jboss-logging:3.2.1.Final -&gt; 3.3.0.Final
  |    |    \--- com.fasterxml:classmate:1.1.0 -&gt; 1.3.1
  |    +--- com.fasterxml.jackson.core:jackson-databind:2.8.3
  |    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.8.0 -&gt; 2.8.3
  |    |    \--- com.fasterxml.jackson.core:jackson-core:2.8.3
  |    +--- org.springframework:spring-web:4.3.3.RELEASE
  |    |    +--- org.springframework:spring-aop:4.3.3.RELEASE (*)
  |    |    +--- org.springframework:spring-beans:4.3.3.RELEASE (*)
  |    |    +--- org.springframework:spring-context:4.3.3.RELEASE (*)
  |    |    \--- org.springframework:spring-core:4.3.3.RELEASE
  |    +--- org.springframework:spring-webmvc:4.3.3.RELEASE
  |    |    +--- org.springframework:spring-aop:4.3.3.RELEASE (*)
  |    |    +--- org.springframework:spring-beans:4.3.3.RELEASE (*)
  |    |    +--- org.springframework:spring-context:4.3.3.RELEASE (*)
  |    |    +--- org.springframework:spring-core:4.3.3.RELEASE
  |    |    +--- org.springframework:spring-expression:4.3.3.RELEASE (*)
  |    |    \--- org.springframework:spring-web:4.3.3.RELEASE (*)
  |    \--- org.springframework.boot:spring-boot-starter-tomcat:1.4.1.RELEASE
  |         +--- org.apache.tomcat.embed:tomcat-embed-core:8.5.5
  |         +--- org.apache.tomcat.embed:tomcat-embed-el:8.5.5
  |         \--- org.apache.tomcat.embed:tomcat-embed-websocket:8.5.5
  |              \--- org.apache.tomcat.embed:tomcat-embed-core:8.5.5
  ...
  </code></pre>
  
  <p>Why isn't <code>spring-boot-starter-tomcat</code> excluded from <code>spring-boot-starter-web</code> ?</p>