无需手动干预即可在Maven Netbeans 8.x中创建src/test/resources [英] Create src/test/resources in Maven Netbeans 8.x with no manual intervention
本文介绍了无需手动干预即可在Maven Netbeans 8.x中创建src/test/resources的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Netbeans中的默认war和jar原型不会创建src/test/resources和src/test/java目录.
The default war and jar archetypes inside Netbeans don't create a src/test/resources and src/test/java directory.
是否有一种简单的方法可以在Maven项目中创建src/test/resources,而无需转到文件"选项卡或手动创建目录?
Is there an easy way of creating src/test/resources inside a Maven project without going to the 'Files' tab or creating the directory manually ?
src/test/java.
src/test/java gets created when you create a new unit test.
大多数Netbeans Maven控件确实很直观,但是手动创建目录却很笨拙.
Most of the Netbeans Maven controls are really intuitive, but manually creating the directory is clumsy.
推荐答案
使用新文件向导创建新文件夹.
Use the new file wizard to create a new folder.
- 右键单击项目的父节点,然后选择新建>文件夹..."或选择文件>新建文件>其他>文件夹"
- 将文件夹
src/test/java
命名为空白文件夹,将其父文件夹留空. - 单击完成,将出现
Test Packages
文件夹. - 重复
src/test/resources
- 似乎有一个错误阻止了
Other Test Sources
被立即识别,因此您必须重新加载右键单击项目>重新加载POM.
- Right click the parent node of the project and choose "New > Folder..." or choose "File > New File > Other > Folder"
- Name the folder
src/test/java
with a parent folder left blank. - Click finish and the
Test Packages
folder will appear. - Repeat for
src/test/resources
- It seems a bug prevents the
Other Test Sources
from being recognised immediately, thus you must reload the pom by right clicking the project > Reload POM.
这篇关于无需手动干预即可在Maven Netbeans 8.x中创建src/test/resources的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文