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

EngineerBetter_DJ picture EngineerBetter_DJ · Mar 12, 2012 · Viewed 14.5k times · Source

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 As of Maven 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.

Is there a way to get this option back?

Answer

akcasoy picture akcasoy · Mar 30, 2013

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.

  • 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

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