Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do 'mvn compile' and 'mvn package' with m2e in Eclipse?

I've started this week to use Maven for some projects I'm working on and I use Eclipse with the m2e plugin. I've been having a look at it but I can't find a way to compile and package (as far as I can see I can do clean, generate-sources, test and install). How can this be achieved with m2e?

like image 216
Alf Avatar asked Apr 25 '12 09:04

Alf


People also ask

How do I run a Maven compile in Eclipse?

Building and Running the Maven Project in Eclipse To run the maven project, select it and go to “Run As > Java Application”. In the next window, select the main class to execute. In this case, select the App class and click on the Ok button. You will see the “Hello World” output in the Console window.

What is m2e in Eclipse?

M2Eclipse provides tight integration for Apache Maven into the Eclipse IDE with the following features: Rich editor for pom. xml files. Launching Maven builds from within Eclipse. Dependency management for Eclipse build path based on Maven's pom.

What is m2e in Maven?

m2e stands for maven to eclipse plugin.


2 Answers

  1. Right click on your project
  2. Run As
  3. Maven build...
  4. Fill in the goals you want
  5. Hit Run
like image 58
Guillaume Polet Avatar answered Nov 04 '22 00:11

Guillaume Polet


You have to create own Run Configuration of type Maven Build. These four are some kind of predefined builds, but you can create really customized own stuff.

like image 38
Michał Kalinowski Avatar answered Nov 04 '22 01:11

Michał Kalinowski