Skip to content

Instantly share code, notes, and snippets.

@ansig
Created July 27, 2017 06:11
Show Gist options
  • Save ansig/8102eaf3d2a72887a2668a2182cef1e3 to your computer and use it in GitHub Desktop.
Save ansig/8102eaf3d2a72887a2668a2182cef1e3 to your computer and use it in GitHub Desktop.
Spring app annotation config to read properties from file on default path or from parameter
@Configuration
@ComponentScan(basePackages = "sen.ansig.spring")
@PropertySource("classpath:config.properties")
@PropertySource(value = "file:${config.path:config.properties}", ignoreResourceNotFound = true)
public class MySpringAppWithProperties {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment