NetBeans 可以自动构建 java 自由格式 (Ant) 项目吗? [英] Can NetBeans auto-build java free-form (Ant) projects?

查看:37
本文介绍了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?

推荐答案

自 NetBeans 8.0 版起,保存时编译选项不适用于自由格式项目.而且我认为将来也不会提供它.自由格式的想法是,IDE 对您的项目一无所知,完全依赖于您提供的 ant 脚本和映射.

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.

如果不想每次修改文件时都构建整个项目,可以在ant中创建一个target来编译单个文件,并将其映射到IDE命令compile.single.如果需要,您可以为此添加上下文菜单,尽管现有的键盘快捷键 F9 应该足够了.

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

这篇关于NetBeans 可以自动构建 java 自由格式 (Ant) 项目吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆