Missing the ‘maven package’ menu entry in eclipse
Asked Answered
B

2

11

I'm using Eclipse 3.7 with m2eclipse. Previously I know there was a menu entry ‘maven package’ but since I reinstalled Ubuntu there is no entry and I have to ‘maven install’ to do the same.

Now I'm wondering if it is possible to get the ‘maven package’ back so I could test something without installing it and allow other projects to use the test version as dependency.

Breeches answered 23/2, 2012 at 22:7 Comment(0)
T
25

Just use Maven Build... and type package in the goal field.

Tridimensional answered 23/2, 2012 at 22:45 Comment(3)
And how could I add this to the menu without define this for each project?Breeches
For all reading this: the solution of @akcasoy actually gives a fuller answer.Unswear
this is what I was looking forJard
L
9

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

At least you will not have to create a new configuration each time you want to package, as with maven build...

Liscomb answered 30/3, 2013 at 19:25 Comment(1)
I'm not sure what the outcome of the step 'select "selected_resource_loc"' should have been. I had 'base directory' pre-filled with my project path. Just keeping that and doin the rest of the steps here worked for me.Quesenberry

© 2022 - 2024 — McMap. All rights reserved.