How do I create a resource so that it is located in the resource folder of my project?
In the following, "test.txt" is a file I want to create, but the variable:url is null, so I can't get a path to the file I want to create.
URL url= HashArray.class.getResource("test.txt");
File file = new File(url.toURI());
The resource probably needs to be located in the resources folder because I need to bundle it with the code in the packaging phase.
Can you be more specific on how you want to do this? Is this a maven plugin by any chance?
以上就是Creating resources in a maven/java project的详细内容,更多请关注web前端其它相关文章!