'Springboot resouse not found when executed from jar file
Springboot app works fine form the IDE. Here is the code in my controller.
var resource = ResourceUtils.getURL("classpath:suitexmls/"+AppProperty.TEST_SUITE_NAME);
TestNG testng = new TestNG();
final String suitePath = resource.getPath();
List<String> xmlList = new ArrayList<>();
xmlList.add(suitePath);
testng.setTestSuites(xmlList);
testng.run();
It works fine form the IDE.
But when I build the jar file and tried to excute as standalone jar file as
java -jar myapp.jar
I got this error: java.io.FileNotFoundException: C:\dev\ToolKit-API\target\Toolkit-0.0.3.jar!\BOOT-INF\classes!\suitexmls\TestSuite.xml (The system cannot find the path specified)
How can I refercee to \suitexmls\TestSuite.xml which is in my reseoruc folder when executing from standalone jar file?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
