Gradle'war'插件不包含我的类文件。以前用这个确切的项目结构做了,但由于某种原因它不再存在,我无法弄清楚它是什么。
这是我的项目结构:
|PROJECT-ROOT
|---|src
| |---|main
| |---|java
| |---|JAVA PACKAGES HERE
|build.gradle
|---|statics
| |---|STATIC FILES HERE (yup I know, you can put them in src/main/webapp but this is better for my purposes)
|---|WEB-INF
| |---|web.xml
的build.gradle:
apply plugin: 'war'
apply plugin: 'idea'
repositories {
mavenCentral()
}
dependencies {
providedCompile group: 'org.apache.tomcat', name: 'catalina', version: '6.0.20'
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1'
}
war {
from('lib') {
into 'WEB-INF/lib'
}
from('statics') {
into ''
}
webInf {
from 'WEB-INF'
}
}