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"));
```
build your project and execute maven generated jar \[\*\*/target/\*-0.0.1-SNAPSHOT.jar\]
`java -jar *-0.0.1-SNAPSHOT.jar`
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"));
```