Spring boot, dependencies - task executed too soon

I have a rather complex project at https://github.com/odpi/egeria which is primarily build using maven (nearly 400 modules).

I’ve been looking at improving the build time - part is splitting the repo, removing unneeded modules etc, but moving to gradle is also very attractive as incremental builds in particular as so quick.

We have gradle builds running, a few specifics on this:

  • We have one project (:open-metadata-implementation:server-chassis:server-chassis-spring) which is a spring boot application. We use the springboot gradle plugin to create an executable jar as as I see it this is done by the time we get to:

:open-metadata-implementation:server-chassis:server-chassis-spring:bootJar (Thread[Execution worker for ':' Thread 3,5,main]) completed. Took 2.55 secs.

  • We then have an assembly ( :open-metadata-distribution:open-metadata-assemblies) which uses the distribution plugin to create an archive, here we gather the jar from the above using

    distributions {
    egeriaomag {
    //distributionBaseName = “${rootProject.name}-distribution”
    contents {
    into(‘server’) {
    // Just the chassis
    from { project(’:open-metadata-implementation:server-chassis:server-chassis-spring’).bootJar }
    fileMode = 0755

    and it continues

There is also a dependency on
implementation project(':open-metadata-implementation:server-chassis:server-chassis-spring')

I’ve tried a few variations like changing bootJar to jar or build, but it makes no difference.

Each time it seems as if the distribution is missing the spring app the first time it’s run, though the second time it works ok - which suggests a little timing window ie a problem with task dependencies. I know this as a little after this we run some FVT tests which consume the assembly created above.

Being fairly new to gradle (though I’ve come a long way) I’m a little unsure how to proceed in correcting this. Can anyone advise?