Class ApplicationPropertiesConfig

java.lang.Object
net.optionfactory.spring.context.propertysources.ApplicationPropertiesConfig

@Configuration @ApplicationProperties public class ApplicationPropertiesConfig extends Object
Read application properties from the following locations:
  1. project.properties from classpath, where properties filtered by maven should be placed;
  2. ${project.name}.properties from classpath, containing unfiltered properties;
  3. git.properties from classpath, containing git information generated by pl.project13.maven:git-commit-id-plugin;
  4. ~/.${project.name}.properties, for local development environment overrides (use this feature responsibly);
  5. /opt/${project.name}/conf/project.properties, for testing/production environment overrides, such as jdbc properties.
Moreover, enables property placeholders (e.g. @Value("${...}")) replacement using the above properties sources. Import this configuration class in every Spring context that requires such application properties.
  • Constructor Details

    • ApplicationPropertiesConfig

      public ApplicationPropertiesConfig()
  • Method Details

    • propertySourcesPlaceholderConfigurer

      @Bean public static org.springframework.context.support.PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer()