I wanted load .json file with relative path (resources/jsonFiles/json.json). Everything work when I started app from IDE, but when I generate .jar file and run it I had error from nullPointer to file source. I checked this jar file and there path was jsonFiles/json.json (on app work /jsonFiles/json.json). So I changed path and generated new .jar file, but this "mvn package" doesn't work, because junit tests don't work - can't find file in app. I couldn't resolve this problem, thanks for help.
Work on app, but don't work in jar:
URL urlToJson = getClass().getResource("/jsonFiles/json.json");
exampleList = objectMapper.readValue(new File(urlToJson.getPath())
, exampleList.class);