【发布时间】:2015-09-03 08:41:36
【问题描述】:
我正在尝试仅将 gradle 用于 Eclipse 中的 jar 依赖项,这意味着我从构建路径中获取了所有 jar 并像这样编写它:compile 'groupid:artifactid:version'。
我在eclipse中使用tomcat 7.0.39(在项目的构建路径中作为库导入),我想将tomcat添加到依赖项中,我写了这个:
apply plugin: 'war'
在依赖子句中:
providedCompile 'org.apache.tomcat:tomcat-catalina:7.0.39'
我从构建路径中删除了 tomcat 库。
但是当我运行服务器时,我得到了这个:
SEVERE: End event threw exception
java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet
at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:855)
at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1051)
有人能解释一下我应该做什么吗?
【问题讨论】: