This is the code snippet:
protected String getHostProperty(String key) {
String hostName = null;
try {
URI baseUri = new URI(this.getBaseUrl());
hostName = baseUri.getHost();
} catch (URISyntaxException e) {
//Skip, unable to retrieve host name
}
return hostConfigService.getProperty(key, hostName);
}
getHostProperty("my.property");
And this is how we can define the property in project.properties with all environments:
my.property.local=successful_LOCAL@registration.com
my.property.dev=successful_DEV@registration.com
my.property.qa=successful_QA@registration.com
0 Comments