You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Edit starters sometimes not adding 'bom' as needed by new dependency #313
But in reality, no bom gets added and the 'pom' will have an error marker on it because dependencies cannot be resolved.
Note: our 'add bom' code will not use a property like ${spring-cloud.version} to refer to the bom version. It will just include the version directly. This is normal, that's how it also worked originally in initalizer itself, but they changed it a while back (maybe it should be changed in edit starters too, but that is a different issue).
Not entirely sure what is going 'wrong' exactly. But here is what happens when I add the 'Function Web'.
This dependency corresponds to a starter with id: 'cloud-function'.
sts requests a pom for the initial selection webflux and the final selection webflux + cloud-function
sts computes a delta between the <dependencies> section in both of these pom files.
the delta shows that one maven dependency was added: org.springframework.cloud:spring-cloud-function-web
sts searches the 'known starters' to find one corresponding to org.springframework.cloud:spring-cloud-function-web.
No such starter is found (This is probably the problem!!!)
=> normally in the next step STS would lookup the starter metadata and check if it requires a bom... then add the bom. This is not happening because starter was not found.
How STS searches for known starters is by using the data from:
The problem is, that doesn't match the dependency that intializer actually added to the pom file. So essentially... the dependency that got added 'magically' instead of this one is unknown to the Edit Starters wizard and so it has no idea that it requires a bom.
I've commited a 'fix' that addresses this specific case. However the 'dependency' metadata we are getting from intializer is fundamentally incomplete. So there's only so much that I can do about this in STS.
The changes I've commited now rely on the 'diff' between two poms to determine when to add a bom to the pom. This works for this specific example.
The problem that remains however is that any pom that has the 'web' variant of the cloud-function dependency will continue to confuse STS 'Edit Starters' to some degree because it is impossible for STS to look at a pom that contains that dependency and infer that it has the 'cloud-function' starter selected.
A symptom of this problem that I could not fix is that if you create a project that has starters "webflux" and "cloud-function" as selected dependencies... then when you open "Edit Starters" on such a project you will not see the "cloud-function" dependency as selected. (Since no maven dependency listed in the pom is associated with the starter dependencies in the metadata STS receives from intializer service).
THe only real way to fix is this on the initializer side.
Activity
kdvolder commentedon Jun 27, 2019
Not entirely sure what is going 'wrong' exactly. But here is what happens when I add the 'Function Web'.
webfluxand the final selectionwebflux+cloud-function<dependencies>section in both of these pom files.org.springframework.cloud:spring-cloud-function-weborg.springframework.cloud:spring-cloud-function-web.=> normally in the next step STS would lookup the starter metadata and check if it requires a bom... then add the bom. This is not happening because starter was not found.
How STS searches for known starters is by using the data from:
https://start-development.cfapps.io/dependencies?bootVersion=2.1.6.RELEASE
kdvolder commentedon Jun 27, 2019
If we examine the info returned from the 'dependencies' url, this is what it lists for 'cloud-function':
The problem is, that doesn't match the dependency that intializer actually added to the pom file. So essentially... the dependency that got added 'magically' instead of this one is unknown to the Edit Starters wizard and so it has no idea that it requires a bom.
kdvolder commentedon Jun 27, 2019
I've commited a 'fix' that addresses this specific case. However the 'dependency' metadata we are getting from intializer is fundamentally incomplete. So there's only so much that I can do about this in STS.
The changes I've commited now rely on the 'diff' between two poms to determine when to add a bom to the pom. This works for this specific example.
The problem that remains however is that any pom that has the 'web' variant of the cloud-function dependency will continue to confuse STS 'Edit Starters' to some degree because it is impossible for STS to look at a pom that contains that dependency and infer that it has the 'cloud-function' starter selected.
A symptom of this problem that I could not fix is that if you create a project that has starters "webflux" and "cloud-function" as selected dependencies... then when you open "Edit Starters" on such a project you will not see the "cloud-function" dependency as selected. (Since no maven dependency listed in the pom is associated with the starter dependencies in the metadata STS receives from intializer service).
THe only real way to fix is this on the initializer side.
spring-projects-issues commentedon Jul 12, 2019
(comment in Pivotal Tracker added by Nieraj Singh:)
Verified in STS4 4.3.1. When I add "Function" via Edit Starters, the following got added to pom.xml: