NetBeans 可以自动构建 Java 自由格式 (Ant) 项目吗?
每次保存后,我需要在项目浏览器中右键单击该项目,然后单击build
。 有没有办法将 NetBeans 配置为在保存文件时自动构建项目?
After every save I need to right-click on the project in the project browser and click on build
.
Is there a way to configure NetBeans to auto-build the project when I save a file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅保存时编译常见问题解答:http://wiki.netbeans.org/FaqCompileOnSave
我不使用 CoS我本人强烈推荐 Jenkins 来满足您的自动构建需求(以及更多): http://jenkins-ci.org /
See Compile on Save FAQ: http://wiki.netbeans.org/FaqCompileOnSave
I don't use CoS myself, I highly recommend Jenkins for your auto-build needs (and so much more): http://jenkins-ci.org/
从 NetBeans 版本 8.0 开始,保存时编译选项不可用于自由格式项目。而且我认为它将来也不会提供。自由格式的真正想法是,IDE 不知道有关您的项目的任何信息,并且完全依赖于 ant 脚本和您提供的映射。
如果您不想每次更改文件时都构建整个项目,请在 ant 中创建一个目标来编译单个文件并将其映射到 IDE 命令compile.single。如果需要,您可以为此添加一个上下文菜单,尽管现有的键盘快捷键 F9 应该足够了。
您可以在此处阅读有关高级自由格式配置的更多信息 - 高级自由格式项目配置
The compile on save option is not available for free-form projects as of NetBeans version 8.0. And I don't think it will be made available in future too. The very idea of free-form is that that IDE does not know anything about your project and completely relies on the ant-scripts and the mappings you provide.
If you don't want to build an entire project every time you make changes to a file, create a target in ant to compile a single file and map it to the IDE command compile.single. You could add a context menu for that if required, although the existing keyboard shortcut F9 should suffice.
You can read more on the advance free-form configuration here - Advanced Free-Form Project Configuration