-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
spring-core-5.2.0.M3.pom missing netty dependencies #23234
Comments
Thank you for picking up this for 23282 |
After discussing with other team members, I've decided to not publish that information anymore in the POMs. While looking at all the "optional" and "provided" dependencies, I've tried to map each to a particular Gradle feature variant to provide richer metadata for build systems. In almost all cases, I didn't make sense because those libraries were not the ones required to enable the supported features. One could think that the versions are still useful, as a guidance for developers; this is also not true, as Spring Framework often supports a range of versions for dependencies. If you're looking for such information, the Spring Boot BOM is the best source of information (and you can use it as well in non Spring Boot apps). Now you could also consider that the dependency information is useful for maintenance reasons (CVEs, bugs, etc). Again, the Spring Boot BOM (and custom version overrides in your application) are much better at this. We'd rather not publish misleading information in our POMs, especially if it's being used by automated tools to make important decisions or provide guidance to developers. I'm closing this issue as a result. |
I see. I agree that it should not publish wrong information.
Would you elaborate on this attempt(s) that gave wrong information? |
Let's take a few examples:
Taking a step back, Spring Framework is built to integrate with many technologies and libraries, and deriving sensible metadata from our build is really hard, if not impossible. |
Thank you for good explanation. On spring-jcl
I think this "more than that" meant a logging backend such as logback-classic and its configuration. In my opinion, declaring optional dependency to slf4j and log4j in pom.xml is still not wrong information. Spring-jcl's logging bridge's role is to forward logs to log4j or slf4j. Picking up logging backend or setting up logger configuration is under slf4j's usage, rather than spring-jcl's usage. My memo on spring-jcl: https://github.com/suztomo/spring-framework-i23234/tree/master/demo-spring-jcl On spring-core depends on netty-bufferYour point makes sense; spring-core is not supposed to be used independently with netty-buffer. My memo on spring-webflux: https://github.com/suztomo/spring-framework-i23234/tree/master/demo-spring-core-netty (Continuing to check your points on servlet...) |
On servlet versionsI picked up examples from spring-web depending on Servlet 3.1 (spring-web:5.1.9.RELEASE) and spring-webflux on Servlet 4 (spring-webflux:5.1.9.RELEASE). These optional dependencies reflect your explanation below quite well:
I don't see having these optional dependencies in published pom.xml misleading. My memo: https://github.com/suztomo/spring-framework-i23234#servlet-versions-in-spring-framework On version clashesOptional dependencies do not cause clashes. Maven adds these optional dependencies to a class path only when it is project's direct dependencies. For example spring-web's pom.xml declaring optional dependency to servlet-api 3.1.0 (as it does in 5.1.9.RELEASE) does not have any effect in a Spring application's project. Users do not need to write exclusions for servlet-api. My memo: https://github.com/suztomo/spring-framework-i23234#servlet-and-clashes On "-all.jar"I agree that having specific dependencies is good thing (regardless of this issue). I only find "netty-all" in spring-web. Created PR: https://github.com/spring-projects/spring-framework/pull/23465/files . I hope this helps. (Continuing to check your points on javax specs...) |
On javax specThe version of a specification used to compile a library indicates that the project supports the These are my feedback on the decision of not adding |
Affects: 5.2.0.M3
Would you declare dependencies in pom.xml when installing spring artifacts to a repository?
Context
Although these optional dependencies of a transitive dependency are only used in compilation time of spring-core and not automatically retrieved by users' build tools, declaring optional dependencies in pom.xml is helpful for the following reasons:
For static analysis tools
I develop a tool to check missing dependency. The tool reads pom.xml of Maven artifacts. The tool detected spring-core 5.2.0.M3 does not have proper dependencies declared in pom.xml.
For human
Declaring these dependencies serves as human-readable documentation. For example some of the classes in spring-core use
io.netty.buffer.ByteBufAllocator
. Declaring optional dependency in spring-core's pom.xml helps its users to pick up correct Maven artifact to make the classes work.With the reasons above, would you declare dependencies in pom.xml when installing to a repository?
Note that spring-core and Netty are just one example pair of this issue. There are many other dependencies that are not shown in spring-core 5.2.0.M3's pom.xml, and probably other artifacts like spring-context.
The text was updated successfully, but these errors were encountered: