java nbactions.xml 有什么用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12163994/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is nbactions.xml used for?
提问by eduardohl
After searching for a little while I figured it has to do with using maven and net beans for building an application, but I can't seem to find good documentation on that. Which goal could be achieved by using nbaction.xml? Which would be its equivalent for Eclipse, if there even is one?
在搜索了一段时间后,我认为这与使用 maven 和 net bean 构建应用程序有关,但我似乎找不到关于它的好的文档。使用 nbaction.xml 可以实现哪个目标?如果有的话,它与 Eclipse 的等价物是什么?
回答by MikeG
The nbactions.xmlfile is used by Netbeans to call custom Maven goals. It is even possible to change the behavior of the built in the "Build, Test and Run" commands in Netbeans using it.
该nbactions.xml文件被NetBeans中调用自定义Maven目标。甚至可以使用它来更改 Netbeans 中“构建、测试和运行”命令中内置的行为。
The project Properties > Actionssettings are stored in this file.
项目属性 > 操作设置存储在此文件中。
There are more details in the accepted answer to this Stack Overflow question relating to defining goals in netbeans: Invoking Actions other than Build and Clean & Build
与在 netbeans 中定义目标相关的 Stack Overflow 问题的已接受答案中有更多详细信息:调用除构建和清理与构建之外的操作
I have not been using Eclipse lately, but I suspect you can easily replicate this functionality using custom run configurations. I believe that using the m2eclipseplugin offers this functionality by invoking Run as... / Maven build.
我最近没有使用 Eclipse,但我怀疑您可以使用自定义运行配置轻松复制此功能。我相信使用m2eclipse插件通过调用Run as... / Maven build 来提供此功能。
You may also find this other Stack Overflow answer helpful configuring m2eclipse: How do I start Maven "compile" goal on save in Eclipse?
您可能还会发现其他 Stack Overflow 答案对配置 m2eclipse 很有帮助:How do I start Maven "compile" target on save in Eclipse?