My file config get generated in build/libs instead of build/classes/java

Viewed 21

I'm trying to create a config file but it get generated in the wrong folder

private File getJarDir() {
        try {
            URI uri = getClass().getProtectionDomain().getCodeSource().getLocation().toURI();
            return new File(uri).getParentFile();
        } catch (URISyntaxException ignored) {
            return new File(".");
        }
    }

uri = /C:/Users/Marco/IdeaProjects/ClientMail/build/libs/ClientMail.jar but class name is cfgImpl.jar

this is the code for getting the location, but i have no clue why now it search on build/lib

I found a config file in the correct location but that was from some days ago, this function didn't change and I have no clue why now it's different, let me know if I need to post more information as I'm new to gradle

0 Answers
Related