3

Although I prefer running Maven from the command line, some of my colleagues are more comfortable launching everything from within Eclipse. For this reason, I'm looking for a way to map all of Maven's command line options to m2e, so I can send them a run configuration.

This StackOverflow question covers -X/--debug, and I feel fairly safe assuming that the 'Parameter Name'/'Value' table covers -D/--define. It's also pretty clear that ticking 'Update Snapshots', 'Non-recursive' and 'Offline' will enable their respective options.

But what about --projects and --also-make, and the other options that don't have corresponding checkboxes? Can these be enabled? Is there a place to add arbitrary switches? Or will I have to create an external tool configuration for this?

If I've overlooked documentation for this, I apologise, and request a link.

Community
  • 1
  • 1
Michael Scheper
  • 6,514
  • 7
  • 63
  • 76

1 Answers1

5

In my version of m2e plugin (which is fairly old but works well: 0.12.1.2011xxx) you would choose (right-click on the project) "Run as..." => "3 Maven build..." and then can choose some options by checkboxes. However you can choose every other command-line option by simply typing it in the goals parameter. As you wrote you can predefine this in a configuration and give those to your colleagues.

Example: If you want to run install with -am (also make) just enter into goals

install -am

and choose a proper name for the configuration. The latter can then be run by

"Run as..." => "2 Maven build"

HTH!

Jan
  • 930
  • 9
  • 25