将新的 Maven 运行配置添加到 Eclipse 的菜单中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10504620/
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
add new maven run configuration to menu in Eclipse
提问by MiB
Is there some way to add to the existing maven configurations in the "run configuration menu", available in "Run -> Run as" in Eclipse? I'd like to add my commonly used goals, like "integration-test", to the existing ones, like "maven build" etc.
是否有某种方法可以将“运行配置菜单”中的现有 maven 配置添加到 Eclipse 中的“运行 -> 运行方式”中?我想将我常用的目标(如“集成测试”)添加到现有目标(如“maven 构建”等)中。
I used the variable "${project_loc}" for base directory, but how can I place the new configuration in the maven run configuration menu? I don't see the option in the preferences or anywhere.
我使用变量“${project_loc}”作为基本目录,但是如何将新配置放置在 maven 运行配置菜单中?我在首选项或任何地方都没有看到该选项。
回答by Eugene Kuleshov
Short answer is you can't. Eclipse generally encouraging to not clutter context menus.
简短的回答是你不能。Eclipse 通常鼓励不要弄乱上下文菜单。
However when using m2eclipseyou can use Run As... / Maven Build...
menu to create launch configurations for your Maven builds. After that you can use Run As... / Maven Build
(or Alt-Shift-X, M shortcut) to invoke previously created configurations, so if there is more then one been created you'll see a selection dialog.
但是,当使用m2eclipse 时,您可以使用Run As... / Maven Build...
菜单为您的 Maven 构建创建启动配置。之后,您可以使用Run As... / Maven Build
(或 Alt-Shift-X、M 快捷键)调用先前创建的配置,因此如果创建了多个配置,您将看到一个选择对话框。