Config
@Configuration
@PropertySources({
@PropertySource("classpath*:properties/test-database.properties")
})
public class DataSourceConfiguration {//...
}
Prop location
D:\Projects\opti\dao\src\main\resources\properties\test-database.properties
D:\Projects\opti\dao\src\main\resources marked as resource folder.
To avoid this kind of problem the issue is to set the jboss.server.config.dir in VM arguments like that :
-Djboss.server.config.dir="[jboss_repository]/server/[default-all-standard-standalone]/conf" –server
and u set PropertySource like this :
@Configuration
@PropertySource("file:${jboss.server.config.dir}/file.properties")
Or you set ur property like that
@PropertySource(value = "classpath:application.properties")
When executed, properties will be imported from the application.properties
file, located in the classpath root.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With