我对 gradle 和构建系统非常陌生,我正在尝试使用 gradle 构建项目,但它找不到我在项目的几个类中使用的 Tomcat 服务器包。
我的构建配置:
apply plugin: 'java'
apply plugin: 'war'
repositories {
flatDir { dirs "WebContent/WEB-INF/lib" }
mavenCentral()
}
dependencies {
compile group: 'com.orientechnologies', name: 'orient-commons', version: '1.3.0'
compile group: 'com.orientechnologies', name: 'orientdb-client', version: '1.3.0'
compile group: 'com.orientechnologies', name: 'orientdb-core', version: '1.3.0'
compile group: 'com.orientechnologies', name: 'orientdb-graphdb', version: '1.3.0'
compile group: 'com.orientechnologies', name: 'orientdb-enterprise', version: '1.3.0'
compile group: 'com.tinkerpop.blueprints', name: 'blueprints-core', version: '2.3.0'
compile group: 'com.tinkerpop.blueprints', name: 'blueprints-orient-graph', version: '2.3.0'
compile group: 'com.tinkerpop', name: 'pipes', version: '2.3.0'
compile group: 'com.tinkerpop.gremlin', name: 'gremlin-java', version: '2.3.0'
compile group: 'com.tinkerpop.gremlin', name: 'gremlin-groovy', version: '2.3.0'
testCompile group: 'junit', name: 'junit', version: '4.+'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
}
sourceSets {
main {
java {
srcDir 'src'
}
}
test {
java {
srcDir 'test'
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.3'
}
war {
from 'WebContent'
}
当我启动 Gradle Task - Build 时发生错误:
OrientDBFilter.java:6: error: package javax.servlet does not exist
import javax.servlet.FilterChain;
OrientDBFilter.java:5: error: package javax.servlet does not exist
import javax.servlet.Filter;
……