我有非常简单的构建jar的build.properties,以及sources.jat = r和javadoc.jar
我不想要最后两个,它会减慢构建速度。
如何告诉gradle NOT不要构建sources.jar和javadoc.jar?
buildscript {
}
group 'com.premierinc.gporev'
version '1.0.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'maven'
jar {
baseName = 'gporev-pentaho'
}
jar {
into 'resources', {
from 'resources'
}
}
// added so Bamboo can extract the GAV variables
// and pass them on
task ('createPom') {
doLast {
pom {}.writeTo("pom.xml")
}
}
clean.doLast { file("pom.xml").delete() }
build.finalizedBy createPom
答案 0 :(得分:0)
选项
javadocJar
或sourcesJar
任务添加到gradle模型中
apply plugin: 'java'
task javadocJar(type:Jar) { ... }
task sourcesJar(type:Jar) { ... }
if (someMagicFlag) {
javadocJar.enabled = false
sourcesJar.enabled = false
}