0

I remember that one of the steps to upgrade my Eclipse workspace from STS3 to STS4 was to remove the command org.springframework.ide.eclipse.core.springbuilder from .project file, as described at https://github.com/spring-projects/sts4/wiki/STS3-Migration.

However, today I saw that one of my projects, that I did upgrade some time ago, is using the following command:

<buildCommand>
    <name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
    <arguments>
    </arguments>
</buildCommand>

Is it something introduced recently in STS4? Or is it still something from STS3 that should be removed? The upgrade guide above doesn't mention it.

Mauro Molinari
  • 1,246
  • 2
  • 14
  • 24
  • This seems to be something that STS3 and STS4 have in common: https://github.com/spring-projects/sts4/blob/master/eclipse-extensions/org.springframework.ide.eclipse.boot.validation/plugin.xml#L29-L38 – howlger Oct 12 '20 at 13:25

1 Answers1

1

Or is it still something from STS3

Short answer: it belongs to STS 4 and should not be removed when migrating from STS 3 to STS 4.

Longer answer:

That particular builder runs 'validation checks' that are specific to STS 4 and are run inside of an Eclipse builder.

However, there is currently only one validation rule defined in that builder. This rule checks for use of @ConfigurationProperties annotation and recommends to add the corresponding annotation processor to the classpath if it is not already there.

Disabling or removing the builder will have no other ill-effects except for disabling that single validation check. So if you do not use Spring Boot @ConfigurationProperties then it will not affect you at all. Even if you do use it (now or in the future), the impact is marginal. Basically, you will have to remember to add the annotation processor dependency yourself manually but won't get a reminder in the form of warning in the editor.

Moving forward, this builder is probably going to be phased out and removed in the future. Newer validations, such as the validation of 'SpEL' expression being implemented more recently, are now being defined in the language server rather than in the Eclipse builder. If we can re-implement the @ConfigurationProperties check in the language server, then it would make sense to get rid of the Eclipse validation builder completely as it would no longer serve a purpose.

So to be totally clear, yes it is part of STS 4, and still doing something useful (in Eclipse), but it predates the adoption of language servers as means to implement things like validations in a way that is not Eclipse-specific.

Kris
  • 3,898
  • 1
  • 23
  • 32
  • Thanks Kris! Since I knew STS4 is using the language server approach, I was not sure whether it was a STS4 thing rather than a STS3 thing, but you cleared it up. Just a last question: is it added/removed automatically by STS4 in some circumstances? I noticed not all my STS4 Spring projects have it in their `.project` file and I never added/removed it manually. – Mauro Molinari Oct 16 '20 at 07:03
  • It gets added automatically but then it remembers in a project property that this was done already. So if you remove it after that it shouldn't be added back automatically anymore. (Unless you delete / edit the `org.springframework.ide.eclipse.prefs` file under `.settings`. This is where it keeps the boolean flag to remember whether builder was added to the project already.) – Kris Oct 16 '20 at 16:12