package com.ankurm.configprops; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.ConfigurationPropertiesScan; /** * Companion application for the ankurm.com article * "@ConfigurationProperties vs @Value in Spring Boot 4". * *

{@code @ConfigurationPropertiesScan} is what registers the {@code @ConfigurationProperties} * types in {@code com.ankurm.configprops.props} as beans. Without it — and without * {@code @EnableConfigurationProperties} or a stereotype annotation on each type — the * classes compile, the application starts, and the beans simply do not exist. That is the first * entry in the failure gallery: see {@code docs/03-registration.md}. */ @SpringBootApplication @ConfigurationPropertiesScan public class ConfigBindingApplication { public static void main(String[] args) { SpringApplication.run(ConfigBindingApplication.class, args); } }