2

TL;DR: is there a plugin for maven, Intellij IDEA's Community Edition or even an external tool that could validate Spring Boot's profile specific application-${profile}.yml configuration files (i.e. checking for missing or misspelled properties)?

We have a Spring Boot project with a default application.yml, an application-test.yml for integration tests, an application-local.yml for local deployment and multiple application-${profile}.yml for different production environments. Each has their own auto-configurations for database, as well as our own properties for the different APIs we call, imported using @Value("${property.name}").

Since they're manually edited, mistakes happen, and we had issues in the past with a missing property on a production profile, causing the deployment for that environment to fail. The problem is that the whole process is quite bureaucratic, with code reviews (that can still miss these little things), approval requests, etc. So when that happens, we have to rollback all the machines deployed to the previous version, fix the missing configuration for that profile, and follow the whole process again.

That's why I was wondering if there was another tool or plugin that could validate these profile-specific properties files before deployment. It could be something that validates if, combining the default application.yml and the application-${profile}.yml, there are no missing properties defined in a @Value annotation in our code.

I know Intellij has a Spring Boot plugin, but it's only for the Ultimate edition, and the Community edition's Spring Assistant isn't active anymore since 2018.

I also tried creating a simple @SpringBootTest with @ActiveProfiles for each one, but they fail because I can't connect to these production servers from my local machine, so that's a no-go.

Tarek
  • 3,080
  • 5
  • 38
  • 54

0 Answers0