I am referring to my post here :Moving Jib configuration of one module into a new module, to refactor multi-module gradle project
With the same refactoring goal of keeping jib related configuration in a separate module, I want to inject some "runtimeOnly" dependencies from the new module so that jar gets added in the classpath.
['jib', 'jibDockerBuild', 'jibBuildTar'].each { jibTaskName ->
task "${jibTaskName}Webapp" {
doFirst {
project(':webapp').jib {
to.image = 'jib-webapp'
// and more ....
}
***project(':webapp').configurations {
dependencies {
runtimeOnly project(':abc')
}
}***
}
finalizedBy ":webapp:$jibTaskName"
}
task "${jibTaskName}App" {
doFirst {
project(':app').jib {
to.image = 'jib-app'
// and more ...
}
}
finalizedBy ":app:$jibTaskName"
}
}
but ./gradlew jibDockerBuildWebapp won't add the ":abc" module artifacts (jar) in the war lib directory. Only way I am able to get this working by adding "runtimeOnly project(':abc') in the ":webapp" module's build.gradle file.. but that's not I intend to do. Can you please suggest how to get this working?
I was searching for diff options in Jib settings if I could add the module dependency there for it to add the artifacts in the lib directory. I need to add additional jars to run a setup program before starting tomcat.