添加了sourceSet web,但没有相应的任务:
apply plugin: 'java'
sourceSets {
web
}
Build tasks
-----------
assemble - Assembles the outputs of this project.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
classes - Assembles main classes.
clean - Deletes the build directory.
jar - Assembles a jar archive containing the main classes.
testClasses - Assembles test classes.
webClasses - Assembles web classes.
我期待以下任务
webJar
Gradle汇编和构建:不构建web sourceSet。
答案 0 :(得分:0)
每个sourceSet没有jar任务,因为在大多数项目中,这个jar都不是必需的。例如,java项目附带两个sourceSets(main和test)。不需要测试sourceSet的jar,因为没有它就可以运行测试。
如果您需要一个jar用于其他源集,您可以轻松创建一个:
task myJar(type:Jar){
from sourceSets.mySourceSet.output
}