I have a maven project with different profiles set in pom.xml with different values. But I do not know how to access the values specified in the profile through java code. For instance -
My pom.xml:
<profile> <id>scaler</id> <properties> <user>xxxxxxx</user> <secret>yyyyyyyy</secret> <proxyHost>172.19.17.13</proxyHost> <proxyPort>9444</proxyPort> <environment>SCALER</environment> </properties> </profile>
Java code is
String serviceurl = "http://"<proxyhost>":<proxyPort>/";
In the java code above, I want to use the proxy node as 172.19.17.13 and the port as 9444, as defined in pom.xml, but how to access these values from pom ?? I will be grateful for your help.
source share