I found 2 solutions for this issue
```
solution1: using Configurations
```
```
Configurations configs = new Configurations();
Configuration config = configs.properties(new File("src/main/resources/xyz.properties"));
```
```
solution2: using ClassLoader
```
```
ClassLoader classLoader = ClassLoader.getSystemClassLoader();
Properties prop = new Properties(); prop.load(classLoader.getResourceAsStream("resources/xyz.properties"));
```
I found 2 solutions
```
solution1: using Configurations
```
```
Configurations configs = new Configurations();
Configuration config = configs.properties(new File("src/main/resources/xyz.properties"));
```
```
solution2: using ClassLoader
```
```
ClassLoader classLoader = ClassLoader.getSystemClassLoader();
Properties prop = new Properties(); prop.load(classLoader.getResourceAsStream("resources/xyz.properties"));
```