title: Gradle Tomcat plugin dependencies
body: <p>Perhaps I'm not understanding Gradle's configurations properly, but I can't seem to make sense of what's going on here. I need org.glassfish.web:javax.servlet.jsp.jstl:1.2.1 in my WAR because Tomcat doesn't provide JSTL, so I put the dependency on the runtime configuration (it's not needed for compilation). The tomcat configuration also requires this package. However, the tomcatRun task will only work if the dependency is ONLY added to the tomcat configuration. If the dependency is added to runtime, or to both runtime and tomcat, or to neither, the following stack trace results:</p>
  
  <pre><code>Servlet  threw load() exception
  org.apache.jasper.JasperException: /WEB-INF/jsp/index.jsp (line: 1, column: 63) Unable to read TLD "META-INF/c.tld" from JAR file "file:/home/rob/.gradle/caches/modules-2/files-2.1/org.glassfish.web/javax.servlet.jsp.jstl/1.2.1/7f687140e9d264ee00eaa924714adf9a82cc18dc/javax.servlet.jsp.jstl-1.2.1.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
      at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
      at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)
      at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:219)
      at org.apache.jasper.compiler.TagLibraryInfoImpl.&lt;init&gt;(TagLibraryInfoImpl.java:184)
      at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
      at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1410)
      at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
      at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
      at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
      at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
      at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:138)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5231)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5518)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  </code></pre>
  
  <p>The gradle code is as follows. The offending line is commented out, allowing tomcatRun to work successfully but preventing my WAR from working. When the line is uncommented, tomcatRun fails and the WAR works.</p>
  
  <pre><code>dependencies {
    runtime 'org.apache.derby:derby:10.10.2.0',
      'com.sun.mail:javax.mail:1.5.2'/*,
      'org.glassfish.web:javax.servlet.jsp.jstl:1.2.1'*/
  
    compile 'javax.mail:javax.mail-api:1.5.2'
  
    providedCompile "javax.servlet:javax.servlet-api:${servletSpec}"
  
    tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
      "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}",
      "org.apache.tomcat:tomcat-dbcp:${tomcatVersion}",
      files('ecj-4.3.1.jar'),
      "org.glassfish.web:javax.servlet.jsp.jstl:1.2.1"
  
    tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
      exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj'
    }
  }
  </code></pre>