Имеется следующий код:
ConfigProperties
***
public class ConfigProperties {
private static Properties PROPERTIES;
static {
try {
PROPERTIES = new Properties();
PROPERTIES.load(new InputStreamReader(new FileInputStream("src/main/resources/config.properties"), "UTF-8"));
}catch (IOException e){
e.printStackTrace();
}
}
public static String getProperty(String key){
return PROPERTIES.getProperty(key);
}
}
***
POM.xml
***
<name>SL_Frame</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<aspectj.version>1.8.4</aspectj.version>
<allure.version>1.3.9</allure.version>
</properties>
<profiles>
<profile>
<id>TestSuite</id>
<properties>
<login>admin</login>
<password>admin</password>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
***
TestExample
***
public class Example {
public static void main(String[] args) {
String a = ConfigProperties.getProperty("login");
System.out.println(a);
}
}
В результате вывода на экран getProperty("login")
мне выдает ${login}, почему?