spring.provides 不再使用

Remove spring.provides files

It does use pom parsing indirectly, since aether parses the poms. The info may look like its duplicating information but it isn’t exactly. The provides is used to resolve ambiguity. Basically if a provides file says that a ‘starter S provides X’… then ‘S’ takes priority over other things that also provide it.

It is surprising how many things end up multiple times in the dependency graph reachable from severral different things. The provides files were added to avoid some surprising/unwanted suggestions. Think of the provides file as a very strong hint to the ide that a boot developer thought ‘if I want to add X to my pom, you should use starter S’. The dependencies inferred from pom are often just accidental and not as ‘deliberate’. (Heuristics like dependency’s depth in the graph were explored but didn’t provide good results).

@dsyer helped with populating the provides files. This was a long time ago and i’m not sure if it has been kept up to date, so the quality of the info in the various provides file may not be as good/complete as it once was. It has also been a bit of a controversial feature. I’m sure a few people like it, but there’s also a lot of folks who have asked how to turn it of.

具體詳見 https://github.com/spring-projects/spring-boot/issues/12435

Stop relying on spring.provides files before Spring Boot 2.1 is GA
spring boot 2.1 GA 後不再依賴 spring.provides

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章