title: org.springframework.boot.context.embedded does not exist - Gradle build Spring Boot Jetty
body: <p>I am trying to replace Tomcat with Jetty, as my embedded servlet container. And then need to use EmbeddedServletContainerCustomizer() to configure redirecting requests at port 80 to port 443 (HTTPS). But I am stuck at the very beginning with these gradlew build errors:</p>
  
  <blockquote>
    <p><em>RedirectHttpToHttpsOnJettyConfig.java:7: error: package org.springframework.boot.context.embedded does not exist</em></p>
    
    <p><em>import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;</em></p>
    
    <p><em>RedirectHttpToHttpsOnJettyConfig.java:8: error: package org.springframework.boot.context.embedded does not exist</em></p>
    
    <p><em>import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;</em></p>
    
    <p><em>RedirectHttpToHttpsOnJettyConfig.java:9: error: package org.springframework.boot.context.embedded.jetty does not exist</em></p>
    
    <p><em>import org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory;</em></p>
    
    <p><em>RedirectHttpToHttpsOnJettyConfig.java:10: error: package org.springframework.boot.context.embedded.jetty does not exist</em></p>
    
    <p><em>import org.springframework.boot.context.embedded.jetty.JettyServerCustomizer;</em></p>
    
    <p><em>...</em></p>
  </blockquote>
  
  <p>Here's my build.gradle:</p>
  
  <pre><code>buildscript {
      ext {
          springBootVersion = '2.0.0.BUILD-SNAPSHOT'
      }
      repositories {
          mavenCentral()
          maven { url "https://repo.spring.io/snapshot" }
          maven { url "https://repo.spring.io/milestone" }
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
      }
  }
  
  apply plugin: 'java'
  apply plugin: 'war'
  apply plugin: 'eclipse'
  apply plugin: 'org.springframework.boot'
  apply plugin: 'io.spring.dependency-management'
  
  ext['thymeleaf.version'] = '3.0.9.RELEASE'
  
  war {
      baseName = 'reachout'
      version =  '0.0.2'
  }
  
  compileJava {
      options.warnings = true
      options.debug = true
      options.compilerArgs += ["-Xlint:deprecation"]
  }
  
  sourceSets {
      main {
          java {
               exclude '**/RedirectHttpToHttpsOnTomcatConfig.java'
          }
      }
  }
  
  repositories {
      mavenCentral()
      maven { url "https://repo.spring.io/snapshot" }
      maven { url "https://repo.spring.io/milestone" }
  }
  
  dependencies {
      compile('org.springframework.boot:spring-boot-starter-thymeleaf')
      compile("org.springframework.boot:spring-boot-starter-web") {
          exclude module: "spring-boot-starter-tomcat"
      }
      compile("org.springframework.boot:spring-boot-starter-jetty")
      compile('org.springframework.boot:spring-boot-starter-actuator')
      compile('org.springframework.boot:spring-boot-starter-security')
      compile('org.thymeleaf.extras:thymeleaf-extras-springsecurity4')
      compile("org.springframework.boot:spring-boot-starter-jdbc")
      compile("org.springframework.boot:spring-boot-starter-data-jpa")
      compile("com.h2database:h2")
  }
  
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  </code></pre>
  
  <p>Any pointers are much appreciated.</p>