I am trying to read a property file from src/main/resources in my Java web application.
The problem is when i tried to load the file using below code
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource(fileName).getFile());
Its trying to fetch file form target classes ad getting Exception
java.io.FileNotFoundException: C:\Users\PL90169\Java%20Projects\MKPFileUploadService\target\classes\config.properties".
How to change file reading directory from target to source folder instead of target. Attached project structure here