Without it, using the maven-publish
plugin is harder than it needs to be.
Currently, I'm able to work around this in a rather haphazard manner:
// make sure bootRepackage is included in task graph
project.tasks.findAll { it.name.startsWith("publish") } .each { it.dependsOn assemble }
// so we can maintain both "normal" and "boot" jars
springBoot {
classifier = 'boot'
}
publishing {
publications {
maven(MavenPublication) {
// "normal" jar
from components.java
// "boot" jar
artifact ("$buildDir/libs/$project.name-$version-boot.jar") {
classifier = 'boot'
}
}
}
}
I'm sure there must be a more elegant way to get the output file from the bootRepackage
task, but it doesn't seem to declare its outputs (ie, bootRepackage.outputs
is empty).
You also can't sign the jar generated by bootRepackage
.
+1. Would be useful to have access to the produced outputs so they can used in combination with other plugins, such as creating a Docker image.
Most helpful comment
Currently, I'm able to work around this in a rather haphazard manner:
I'm sure there must be a more elegant way to get the output file from the
bootRepackage
task, but it doesn't seem to declare its outputs (ie,bootRepackage.outputs
is empty).