I have a library that I want to upload to maven central and use it in various projects. I am using a text file for better entropy for cryptography (diceware).
Now the problem is that even though maven says this file should be found if referenced to be in src/main/resources/neededfile.txt, however I am having a FNF exception.
How should I reference to the file so that it can always find it internally in the library ?
try {
f = new File("src/main/resources/diceware.txt");
if (f.exists() && !f.isDirectory()) {
file = f;
}else {
f = new File("src/main/java/io/recheck/client/diceware.txt");
if (f.exists() && !f.isDirectory()) {
file = f;
}else {
f = new File("diceware.txt");
file = f;
}
}