With help from “Steve973” on IRC, I’ve been able to resolve part of this, which is how to gather the three required dependencies into a single place, so I can later refer to them somehow in the docker plugin.
I now have the following, which at least produces the artifacts I need to include in the image:
`dependencies {
runtime project(":ordersService")
runtime project(":ordersGUI")
runtime “oracle:ojdbc6:11.2.0.3”
}
task copyDependencies << {
configurations.runtime.setTransitive(false).resolvedConfiguration.resolvedArtifacts
.each { artifact ->
project.copy {
from artifact.file
into "${buildDir}/dependencies"
rename { “${artifact.name}.${artifact.extension}” }
}
}
}
build.dependsOn copyDependencies`
Now that I have them in a single place, I have to have a “docker” config block something like this:
docker { name 'ssorderprocessingdashboard' dockerfile 'src/docker/Dockerfile' files "ordersService.war", "ordersGUI.war", "ojbdc6.jar" }
But this isn’t quite right, because those three files are in “${buildDir}/dependencies”, so this fails to find them. I could add that prefix to all three of the files, but that’s messy. I thought I could do something like this:
files ["ordersService.war", "ordersGUI.war", "ojbdc6.jar"].each { "$buildDir/dependencies/" + it }
But this just fails with “Could not get unknown property ‘files’ for object of type com.palantir.gradle.docker.DockerExtension.”