Posts tagged ‘mave eclipse integration’

Maven within Eclipse

Once again, I heard the sentence : “Hey! You know Maven, do you use Eclipse ? If so, there is a wonderful plugin named MevenIDE try it !“.
Well, I’ve tried MevenIDE 6 months ago, and I didn’t see anything in it which made me think that it was worth to slow even more my Eclipse.
More, I use maven & eclipse daily, and I have a bunch of external task which are calling Maven in the background with NO cost to my much beloved computer memory.
To create a new external task :
1. Go into Run -> External Tools -> External Tools.
2. A Dialog opens click on the button labelled New in the bottom left.
3.Then copy the following in the first tab :

4. On the second tab enter the following :
5. Now you have a new external Task which you can launch from the standard Eclipse cool bar. You’ll have the result of the maven run directly into the Eclipse console.

  • This setup works wathever the version of maven you are using. Once again we rely on the MAVEN_HOME system variable. So changing it, change the maven binary called (Location line of step 3).
  • It works also whatever project you’re currently working on we rely here on a Eclipse variable. ${projectloc} which takes the value of the project currently selected. (having a resource selected within this project count as a project selection).
  • The Arguments line is where you specify the maven goal you want to call. If you need to call maven for other goals (I usually have maven eclipse & maven site:generate ready). You can copy the whole external task and only change the title and the arguments to match a new maven goal (by right clicking on a task an selecting copy)
  • Last step is for telling eclipse to refresh the project. If you use xdoclet, or any kind of code generation tool via maven, the new sources will appears once the maven goal has ended (also useful when calling maven eclipse when you have updated your pom).

You have the same efficiency as mevenide, more free memory available to your IDE, and you’ve learn a little bit more of maven & eclipse.