Eclipse 的 Run As > Maven Package 去哪里了?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9665569/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:49:35  来源:igfitidea点击:

Where did Eclipse's Run As > Maven Package go?

eclipsemavenm2eclipsests-springsourcetoolsuite

提问by EngineerBetter_DJ

In an older version of Eclipse, the number of which I can't remember, there was an option when right-clicking a project under Run Asof Maven Package.

在旧版本的Eclipse,我不记得是哪的数量,有当右键单击下一个项目的选择Run AsMaven Package

In Springsource Tool Suite 2.9.0 built on Eclipse 3.7.2, this option is no longer there. I could create specific run configurations per project to quickly do a Maven package, but I found it rather handy having the one shortcut for doing a package no matter which project was selected without having to set it all up first.

在基于 Eclipse 3.7.2 构建的 Springsource Tool Suite 2.9.0 中,此选项不再存在。我可以为每个项目创建特定的运行配置以快速执行 Maven 包,但我发现无论选择哪个项目,都可以使用一个快捷方式来执行包,而无需先进行全部设置。

Is there a way to get this option back?

有没有办法恢复这个选项?

采纳答案by Andrew Eisenberg

If you prefer the features of the old m2eclipse, you can revert using the STS extensions page. Open up the STS dashboard and click on the extensions page at the bottom. Scroll down until you see the "m2eclipse" entry. Installing this, will uninstallm2eclipse v1.0 and install m2eclipse v0.13.

如果您更喜欢旧的 m2eclipse 的功能,您可以使用 STS 扩展页面恢复。打开 STS 仪表板并单击底部的扩展页面。向下滚动,直到看到“m2eclipse”条目。安装这个,将卸载m2eclipse v1.0 并安装 m2eclipse v0.13。

回答by akcasoy

I also recently wanted to have this option with the new version of m2eclipse. The best solution i could find is, to create a configuration with the goal package, and as base directory give a variable name ${selected_resource_loc}. Still you have to go to run configurations page, but at least you don't have to define a new configuration for each project, but use the predefined one.

我最近也想在新版本的 m2eclipse 中使用这个选项。我能找到的最佳解决方案是,使用目标包创建配置,并作为基本目录提供变量名称 ${selected_resource_loc}。你仍然必须去运行配置页面,但至少你不必为每个项目定义一个新的配置,而是使用预定义的配置。

  • right-click project
  • run as
  • run configurations..
  • double click maven build (to create a new configuration)
  • give a name for configuration e.g. package
  • click variables
  • select "selected_resource_loc" and click ok
  • write your goal e.g. "package" or "clean package"
  • run
  • 右键单击项目
  • 运行为
  • 运行配置..
  • 双击 maven build(创建新配置)
  • 为配置命名,例如包
  • 点击变量
  • 选择“selected_resource_loc”并点击确定
  • 写下你的目标,例如“包”或“干净的包”

The next time when you want to package another project, you can use this configuration again:

下次要打包另一个项目时,可以再次使用此配置:

  • right-click project
  • run as
  • run configurations..
  • select your maven configuration
  • run
  • 右键单击项目
  • 运行为
  • 运行配置..
  • 选择您的 Maven 配置