Creating resources in a maven/java project

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前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准