All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.optionfactory.spring.context.propertysources.ApplicationPropertiesConfig Maven / Gradle / Ivy

There is a newer version: 20.1
Show newest version
package net.optionfactory.spring.context.propertysources;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy