Hi,
I found my build script works well in version 2.3 and 2.4, but runs failed in version 2.5~2.7.
Please help me to figure out where the problem exists.
My multi-projects try to build a root war file to include all subprojects’ artifact jars.
Directory just like this
/root/build.gradle
/subproject1/build.gradle
/subproject2/build.gradle
/.../
And the following are settings and scripts:
root/settings.gradle
def projects = [
'ka'
]
for (proj in projects) {
include proj
project(":" + proj).projectDir = new File("../" + proj)
}
root/build.gradle
dependencies {
subprojects.each { p ->
compile project(path: p.path, configuration: 'warLibs')
compile project(path: p.path, configuration: 'compile')
}
}
ka/build.gradle
configurations {
warLibs
}
sourceSets{
api {
// just ignore
}
core {
// just ignore
}
}
task apiJar(type: Jar) {
archiveName "$projectName-api-$version" + ".jar"
from sourceSets.api.output
}
task coreJar(type: Jar, dependsOn: apiJar) {
archiveName "$projectName-core-$version" + ".jar"
from sourceSets.core.output
}
artifacts {
warLibs apiJar
warLibs coreJar
}
The expected result is a war file in this layout
root.war/
--WEB-INF/
---- lib/
------ ka-api-1.0.jar
------ ka-core-1.0.jar
but since Gradle version 2.5, the war file layout change to
root.war/
--WEB-INF/
---- lib/
------ ka-api-1.0.jar
I don’t know why the second jar, ka-core-1.0.jar, disappered…
I also see the release notes from version 2.5, 2.6, 2.7, and didn’t find any description about it.
Please help, thank you.
Sincerely,
Micky