Hello. I am having some difficulty using composite...
# community-support
f
Hello. I am having some difficulty using composite builds. I have a multiproject (called "framework") which I have included in another project, using
includeBuild
. Inside the nested project, I have a number of subprojects, for example "web" and "security". I also have a "meta" subproject, which declares all the other subprojects as dependencies. My issue is that if any of the subprojects have an external dependency declared with
api
, for example
api("org.springframework.boot:spring-boot-starter-security")
, then the whole nested multiproject fails to build with
Copy code
> Could not find org.springframework.boot:spring-boot-starter-security:.
     Required by:
         project :framework:meta > project :framework:security
When working with the "framework" project directory, i.e. without
includeBuild
, it works fine. If I declare the dependencies as
implementation
instead of
api
, it works fine, but then of course I have to declare the dependencies in depending subprojects. Any help would be appreciated, because at this point I'm really out of ideas, and feel like I will have to scrap the whole idea of having the "framework" be a multiproject.
v
Are you using the Spring dependency management plugin?
f
I am, though should note that this isn't limited to Spring. I get the same error if I add any other dependency.
v
You should stop using it. It is a relict from times when Gradle did not have built-in BOM support. By now it does more harm than good. Even its maintainer recommends not to use it anymore, but the built-in BOM support using
platform(...)
. This will most probably also solve your problems, as they are one of the many drawbacks you earn by using it.