Skip to content

Clean up log4j-spring-cloud-config-client dependencies #2166

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

Merged
merged 2 commits into from
Jan 19, 2024

Conversation

ppkarwasz
Copy link
Contributor

We minimize the dependencies of log4j-spring-cloud-config-client to those really required: spring-context and spring-cloud-context.

The dependency on spring-boot-autoconfigure is optional (its just used in annotations) and the artifact can be also used without Spring Boot.

Fixes #2157.

@raffig
Copy link

raffig commented Jan 5, 2024

It seems to be OK, however from my personal point of view I would say that Spring related properties should not be in log4j-parent/pom.xml, because in general log4j has nothing to do with Spring. Only this module depends on Spring, so I would place it in log4j-spring-cloud-config-client/pom.xml. What you think?

Copy link
Member

@vy vy left a comment

Choose a reason for hiding this comment

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

I recently put significant effort to get log4j-parent rid off Spring-related dependencies. @raffig agrees with the earlier design too, see his comment. Could you please update the PR such that log4j-parent is untouched and log4j-spring-cloud-config-client changes only contain the fix to #2157, please?

@ppkarwasz
Copy link
Contributor Author

@vy,

I moved the Spring dependencies back to log4j-parent, because I managed to remove spring-boot-dependencies and spring-cloud-dependencies from the imported BOMs.

Since these dependency-management-polluting artifacts are out of the picture, I don't see a difference between log4j-spring-cloud-config-client and e.g. log4j-mongodb4: the dependencies of the latter are also in log4j-parent, even if no other artifact uses them.

@raffig
Copy link

raffig commented Jan 6, 2024

I would say that dependencies specific to log4j-mongodb4 should be in that module as well.

@ppkarwasz
Copy link
Contributor Author

To be clear, the parent module log4j-parent does not depend on any of these libraries, it only contains them in the dependency management section.

@vy, why should spring-cloud-context versions be managed in the log4j-spring-cloud-config-client, when at the same time all the other dependencies are managed in the parent module?

We minimize the dependencies of `log4j-spring-cloud-config-client` to
those really required: `spring-context` and `spring-cloud-context`.

The dependency on `spring-boot-autoconfigure` is optional (its just used
in annotations) and the artifact can be also used without Spring Boot.

Fixes apache#2157.
@ppkarwasz ppkarwasz merged commit 8bbc085 into apache:main Jan 19, 2024
@ppkarwasz ppkarwasz deleted the spring-cloud-deps branch January 19, 2024 16:49
@vy
Copy link
Member

vy commented Jan 21, 2024

@ppkarwasz thank you so much for your effort and understanding in this PR. You also have done a great job by introducing our agreement here as a general policy to the Log4j team. All in all, thank you very much! 🙇

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.

3 participants