title: Configure embedded tomcat with Gradle
body: <p>I was trying to run <a href="https://github.com/habuma/SpringInActionExamples/tree/master/Chapter_05/Spittr" rel="nofollow">sample app</a> given in <a href="http://www.manning.com/walls5/" rel="nofollow">Spring in action</a>(4th edition) but not able to configure tomcat with in build.gradle script,I have try to put the tomcat plugin with in script as</p>
  
  <pre><code>apply plugin: 'war'
  apply plugin: 'idea'
  **apply plugin: 'com.bmuschko.tomcat'**
  
  dependencies {
      compile "org.springframework:spring-webmvc:$springVersion"
      compile "org.springframework:spring-jdbc:$springVersion"
      compile "com.h2database:h2:$h2Version"
      compile "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
      compile "org.apache.commons:commons-lang3:$commonsLangVersion"
  
      compile "javax.servlet:jstl:$jstlVersion"
      providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
      providedCompile "javax.servlet.jsp:jsp-api:$jspApiVersion"
      providedCompile "javax.el:javax.el-api:$jspElVersion"
  
    **classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.2'**
  
    **def tomcatVersion = '7.0.59'
      tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
         "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}",
         "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}"**
  
      testCompile "junit:junit-dep:$junitVersion"
      testCompile "org.springframework:spring-test:$springVersion"
      testCompile "org.mockito:mockito-core:$mockitoVersion"
      testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
  }
  
  repositories {
      maven { url 'http://maven.springframework.org/release' }
      maven { url 'http://maven.springframework.org/milestone' }
      maven { url 'http://maven.springframework.org/snapshot' }
      maven { url 'http://download.java.net/maven/2' }
      mavenCentral()
      **jcenter()**
  }
  
  task wrapper(type: Wrapper) {
      gradleVersion = '2.1'
  }
  
  war {
          baseName = 'spittr'
  }
  </code></pre>
  
  <p>But it always fails build giving error:</p>
  
  <pre><code>Plugin with id 'com.bmuschko.tomcat' not found.
  </code></pre>
  
  <p>I have encapsulate settings in ** that I have used for tomcat configuration.</p>