History of this issue is here on this stackoverflow post how-to-build-distribution-package-in-multi-module-gradle-project
I have a test project setup on github github https://github.com/KiranMohan/study-spring-boot.
This is the project setup of interest.
include ':sb-2.1-multi-package', ':sb-2.1-multi-package:hello-rest-lib',
':sb-2.1-multi-package:hello-rest-standalone-jar',
':sb-2.1-multi-package:hello-rest-war'
include 'sb-2.1-3pp-resources'
include 'sb-2.1-build'
However adding hello-rest-war to sb-2.1-build.tar.gz fails.
* What went wrong:
Execution failed for task ':sb-2.1-build:distTar'.
> Could not resolve all files for configuration ':sb-2.1-build:javaDeps'.
> Could not find org.springframework.boot:spring-boot-starter-tomcat:.
Required by:
project :sb-2.1-build > project :sb-2.1-multi-package:hello-rest-war
* Try:
The war file in hello-rest-war
do get compiled and built correctly if sb-2.1-build
is removed from the project setup. So I assume something is wrong with the build.gradle file of sb-2.1-build
module.
Please help me resolve this issue.
Update:
The errors are resolved after changing the below line in hello-rest-war/build.gradle
providedCompile "org.springframework.boot:spring-boot-starter-tomcat"
to
providedCompile "org.springframework.boot:spring-boot-starter-tomcat:$springBootVersion"
Seems to be a bug either in spring boot gradle plugin or with gradle itself that Version is not resolved for providedCompile
dependency.