Skip to content

Gradle plugin does not include transitive project dependencies into application layer #25163

Closed
@edudar

Description

@edudar

Using Spring Boot 2.4.2, layers configuration include project dependencies into application layer by default such as

bootJar {
  layered {
    dependencies {
      intoLayer("application") {
        includeProjectDependencies()
      }

This, however, takes only immediate project dependencies into account. When a project has 3+ levels of modules, like

data {
}

common_services {
  dependencies {
    api project(":data")
  }
}

my_app {
  dependencies {
    implementation project(":common_services")
  }
}

layers.idx for my_app will be like

- "dependencies":
  - "BOOT-INF/lib/data-1.0.0.jar"
- "application":
  - "BOOT-INF/lib/common_services-1.0.0.jar"

A workaround is to include both data and common_services as project dependencies in my_app. It'd be good if the plugin would lookup by project hierarchy to include all project dependencies.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions