Closed
Description
Say there is a Gradle multi-project build with, for example, 2 sub-projects, projectA and projectB and projectA has a runtime dependency on projectB. If the build task for projectA is run without building projectB first, then the jar for projectB doesn't get included in the repackaged jar.
The output for running gradlew clean :projectA:build
is as follows:
:projectB:clean
:projectA:clean
:projectA:compileJava
:projectA:processResources
:projectA:classes
:projectA:jar
:projectA:bootRepackage
:projectA:assemble
:projectB:compileJava
:projectB:processResources
:projectB:classes
:projectB:jar
:projectA:compileTestJava UP-TO-DATE
:projectA:processTestResources UP-TO-DATE
:projectA:testClasses UP-TO-DATE
:projectA:test UP-TO-DATE
:projectA:check UP-TO-DATE
:projectA:build
The projectB jar is only built by Gradle because it might be used in tests. When the bootRepackage task runs, the jar is not present and is not present in the final fat jar.