Skip to content

When building with Gradle, include project dependencies in the application layer by default and make it easer to customise their location #23431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nucatus opened this issue Sep 21, 2020 · 1 comment
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@nucatus
Copy link

nucatus commented Sep 21, 2020

Although the issue is discussed in the #23003 issue, I would like to bring it up since this seem to be, more or less, a deal breaker requirement.

It is pretty common for microservice applications that employ the client-server architecture to expose a lib module that is defined as a subproject of the main application and is used at compile time in both, the server and the client application. This can be, for instance, the model package of the server application, that can be easily shared with the client applications.

In a typical CI/CD flow, you have the main application compiled with every commit in the code base, but the lib module being compiled and published only when changes fall in its realm. Thus, you want to produce the lib artifact only when affected by changes, but keep it as it is otherwise.

In our use case, the majority of the code changes impact the main application, and not the lib. Thus, multiple builds of the main server application should share a common layer of dependencies. However, this is not the case, because gradle will include fresh builds of the subprojects in the dependencies of the parent project, which renders docker layers cache unusable.

The solution, of course, might be a dedicated layer, out of the box, for the gradle subprojects. As I understand, this is not a common ground with the maven infrastructure, but maybe this is a strong use case where we need to favor gradle and at least fix half of the problem.

Also posted the issue on stackoverflow, which comes with a dirty fix.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 21, 2020
@philwebb philwebb changed the title Dedicated layer for subproject artifacts Update image generation support in Gradle for project dependencies Sep 21, 2020
@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 21, 2020
@philwebb philwebb added this to the 2.4.x milestone Sep 21, 2020
@wilkinsona wilkinsona changed the title Update image generation support in Gradle for project dependencies When building with Gradle, include project dependencies in the application layer by default Sep 22, 2020
@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Sep 23, 2020
@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label Sep 23, 2020
@wilkinsona wilkinsona self-assigned this Oct 15, 2020
@wilkinsona wilkinsona changed the title When building with Gradle, include project dependencies in the application layer by default When building with Gradle, include project dependencies in the application layer by default and make it easer to customise their location Oct 15, 2020
@wilkinsona
Copy link
Member

wilkinsona commented Oct 15, 2020

In addition to packaging them in the application layer by default, we should also update the DSL to allow their layer to be customised more easily.

@wilkinsona wilkinsona modified the milestones: 2.4.x, 2.4.0-M4 Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants