Skip to content
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

[java] Add sundrio to generate builders #4931

Merged
merged 2 commits into from
Nov 28, 2023
Merged

Conversation

andreaTP
Copy link
Contributor

Add sundrio to generate builder pattern for the model classes of the generated CRD.

With the upcoming version of kubernetes-client-bom-with-deps we should be able to remove the explicit versions of sundrio and lombok too.

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to decline this one. We already discussed with the community the opportunity to use code generators such as Lombok. With a negative answer.

@claudio4j
Copy link
Contributor

@andreaTP what would be the use case to manipulate Camel K k8s objects ?

@andreaTP
Copy link
Contributor Author

@squakez in this case both Lombok and Sundrio are used only at compile time and are not transitive dependencies for the user.

@claudio4j :
@lburgazzoli asked to have builder pattern on the models and, as far as it works it's a much nicer user experience.

@squakez
Copy link
Contributor

squakez commented Nov 28, 2023

Okey. Maybe, given that this is an auto generated project where user is not meant to manually compile it, we can accept it. @oscerd wdyt?

Copy link
Contributor

@oscerd oscerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope we can remove lombok even if it's only a runtime dependency.

@squakez squakez merged commit e39316f into apache:main Nov 28, 2023
10 of 13 checks passed
@squakez
Copy link
Contributor

squakez commented Nov 28, 2023

@andreaTP please, remind to remove the dependencies in the future when no longer necessary. Thanks!

@andreaTP
Copy link
Contributor Author

@oscerd and @squakez I'm not sure about those last comments, both lombok and sundrio are marked as "provided".

This means that they will be available on the classpath only during compilation and they are not going to be considered transitive dependencies of the resulting artifact.

remove lombok even if it's only a runtime dependency.

It's not a runtime dependency and we can't remove it to get the generated builder pattern.

remind to remove the dependencies in the future when no longer necessary

Just to be clear, the only thing I will change over the current configuration is the removal of the explicit sundrio and lombok version and relevant "property".

@oscerd
Copy link
Contributor

oscerd commented Nov 28, 2023

Our idea is to avoid Lombok as much as we can. Since this is a separated context for generating stuff, that's fine, but we would like to avoid the spreading of Lombok around the codebase. It's provided and that's fine.

@andreaTP
Copy link
Contributor Author

agreed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants