Skip to content

Support Initializr Metadata v2.2 #138

Closed
@snicoll

Description

@snicoll

The Spring team has recently decided to switch their version scheme to SemVer format. This had an unexpected result for remote clients of start.spring.io as the format of the Spring Boot versions (bootVersion attribute) and the compatibilityRange in some dependencies can have an unexpected format.

We figured it out and translated those formats to the original format on the fly. This fixes the problem but is not ideal as remote clients can have a version pattern that actually does not exist. We've introduced a new metadata version, v2.2 that does not do that translation. Going forward, the original format and the new SemVer format can coexist. Ultimately, only the SemVer will remain once the Spring Boot releases using the original format go EOL.

In order to consume that format, the client needs to understand semVer, in particular for version ranges. I don't know if this plugin is impacted by if it is, VersionHelper should be impacted.

For some time, both v2.1 and v2.2 should be supported. start.spring.io supports both obviously but the user may point to a custom instance that hasn't been upgraded yet. You could use content negotiation to mark a preference for 2.2 and consume 2.1 if it's not available, something like

Accept: application/vnd.initializr.v2.2+json,application/vnd.initializr.v2.1+json;q=0.9

(the default factor is 1.0). I believe this should be done in ServiceManager. The actual version can be checked in the Content-Type attribute of the reply although it shouldn't matter to you once you understand both version formats.

Let me know if something isn't clear. Thanks a lot for your hard work on this plugin!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions