-
Notifications
You must be signed in to change notification settings - Fork 41k
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
Remove spring.provides files #12435
Comments
I've never understood the point of If the If they're somehow intended for use when a starter isn't on the classpath, referring to the starter's pom would seem to be a more accurate way of determining the transitive dependencies that it provides. It also avoids the risk of I cloned spring-projects/spring-ide and searched for uses of
If the assumptions I've made about how |
I'm still none the wiser after looking at the commit that introduced the initial batch of |
It was (or is) used by STS, but I don't think any of the other IDEs ever used the data. The jar doesn't have to be on the classpath for STS to read and cache the data, which I think is the point. But it wasn't a very successful feature IMO, and I never use it much. |
I think STS downloads a big XML file from a remote endpoint to allow JAR completion. The XML file seems to be generated using this project. Take a look at SpringProvidesInfo.java |
Thanks, @philwebb. I still don't understand the benefit of a |
I've no idea, I guess we need some input from @kdvolder. Perhaps we thought that using the entire POm would give too many false positives. FWIW I don't really like the IDE feature anyway. I've always found starting with an import and updating the POM file a little backward. |
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. |
I've re-purposed this issue to remove the This issue caused us to review a few, and we can see they have indeed become out of date. Take spring-boot-starter-data-jpa for example which has a provide for I think scanning a starter pom for the immediate dependencies that it declares should probably be enough of an indication for the IDE. I'll raise a Spring IDE issue to see how they want to proceed. |
Spring Boot itself removed all spring.provides files in 2018 See spring-projects/spring-boot#12435 for more information
Spring Boot itself removed all spring.provides files in 2018 See spring-projects/spring-boot#12435 for more information
There isn't a single reference of
spring.provides
in the reference doc and users are wondering what they should do with it (looking at the official starters).There was an answer in #1926 but I think it should be clarified and/or adapted.
The text was updated successfully, but these errors were encountered: