I created a Java project containing three configuration files
I put these three files in a resource folder.
Then I created the jar file of my project. This jar file is added to another project. It cannot find the correct location of the configuration files.
My file structure:
thank
You can use it as.
ClassFromWhichYouAreACcessingTheseFiles.class.getResources("resources/log4j.properties");
than if you add this jar to another project, you can access it.
If your configuration files fall into the WEB-INF / classes folder
ClassFromWhichYouAreACcessingTheseFiles.class.getClassLoader().getResources("log4j.properties");
" " ClassFromWhichYouAreACcessingTheseFiles
Source: https://habr.com/ru/post/1774496/More articles:What does the Min Loser Tree look like with 11 players? - data-structuresDNN Scheduler Won't Run My Own Schedule - dotnetnukeAccess to an external structure with the same name - c ++Magento: атрибут с тысячами значений/параметров - objectASP.NET - How to get to the Div control in ContentPlaceHolder? - htmlHow to use event driven SAX parser (Simple API FOR XML) in C # or is it better to use the System.XML namespace? - c #How to read formatted text view of cell in Excel - excelRunning Selenium RC as a Windows service - selenium-rcNullPointerException in an Android app running on GPS - androidRails 3- Вложенные объекты (повторное использование модели адресов) - mysqlAll Articles