PreviousNext…

Using Mevenide

Screenshot of the Mevenide contextual menu in EclipsePart two of my occasional Maven series now follows. Feel free to disregard if you’re in Domino-land ;-) In this post I hope to provide some useful pointers for getting Mevenide Eclipse, the Maven plug-in, to work in er, Eclipse.

This all assumes you actually have Mevenide installed. If you don’t, go and do that first. OK? Right. Now, before right-clicking on a project and trying to do the Maven thang all over it, might I suggest that you ensure you have set everything up properly?

Setting up Maven

  • Check that the project is actually a Maven-ised project. i.e. its organisation is sensible*, and you have added the relevant artifacts (at the very least, project.xml)
  • … Better yet, why not simply create a new Maven project in your Eclipse workspace by selecting File / New / Other… / Maven / Maven Project
  • Check that the plug-in has been configured in Eclipse: (Windows / Preferences… / Maven)
  • Pay special attention to the “Locations” section. For example, the Java home field is not as it appears: you’d think that it would be the same as your system’s JAVA_HOME variable wouldn't you? i.e. something like c:\j2sdk1.4.2_06\ (the path to my Java SDK). Well, in actual fact, it should be like this: c:\j2sdk1.4.2_06\jre. Yup, you need to point it at your JRE, rather than your Java library or binaries.
  • Set up your project.xml file properly. Specifically, the relative paths to your source and test folders should be set-up. Here’s a sample extract from this file:
 <build> <sourceDirectory>main/src/java</sourceDirectory> <unitTestSourceDirectory>main/test/java</unitTestSourceDirectory> <unitTest> <includes> <include>**/*Test.java</include> </includes> </unitTest> </build> 

* what constitutes “sensible organisation”? Well, Maven likes source code, resources and tests to be clearly differentiated — which makes sense — and so something like the following directory structure is appropriate. Note also the presence of a target directory for all the stuff that Maven compiles, generates, and otherwise buggers about with:

 main/src/java main/test/java … target/classes target/test-classes target/test-reports 

So, create yer project.xml file, set up the directories you may require, and your project is ready to be Maven-ised!

Troubleshooting

  • Unspecified launch error when running Maven: double-check all your locations in the preferences pane
  • Console notification about classes and / or test classes not being found: edit your project.xml file so that Maven knows where to find your source
  • Console errors about missing tzmappings: edit the Java home preferences field to point to a valid JRE (ZoneInfoMappings data are usually found in the \jre\lib\zi folder).

Next time on your friendly Maven channel: “Yes, yes, but does this actually help me get anything done?”

Comments

  1. Images on the web are funny things… Sometimes the letter 'm', when rendered in an image, ends up looking like 'rn' on my screen.

    Which is why, just seeing the screen screenshot that had a menu option reading, 'Create pom…' It gave me a totally different impression of what the post was going to describe.

    Dave#
  2. If locations are so important in setting up Mavenide, one would think that the correct settings might be documented.
    I paid a lot of attention to the locations; stared at the fields for minutes on end but it really did not help. Reading the Mavenide installation and the exhaustive discussion here of this important topic also did not help.
    Couldn't someone just write down what each one of them means and describe how to set it up so that I get things where they should be and perhaps a wee mention of anything that these choices affect in the project.xml file. (Where mavenide makes up its own variables not based on what is in locations)
    I am trying for get Jetspeed2 running under Eclipse and quality of documentation on both sides is abysmal.
    I did have it almost working with the repository and cache under the eclipse project but in the end, some variable was missing in the jetspeed xml files (or in Mavenide) and one of the Jetspeed task could not find the cache.
    Thanks for the note about the jre. That solved one problem that occurred when I set the fields to the defaults. The default does not point to a jre for some unfathomable reason. I had it working but the default is screwy.
    Ron Wheeler#
  3. Well, I guess you get what you pay for Ron. You know developers hate documentation, so unless you have a VERY keyed-up coder on the team, or they employ the talents of a technical writer (highly unlikely), that's where open-source projects often falter ;-)

    It’s my intention with this site that I document things as I go; if I hit an issue, I’ll write about it. I’ve found that many other people do the same nowadays, so don’t despair, we’ll work it all out!Ben Poole#
  4. Hey Ben, I which versions exactly are you using? I've installed Mevenide before (couple months ago), and i got it working right away, but now as i try to redo it keep struggling both with eclipse 3.1.1 and 3.0.2.

    Any hints are highly appreciated.
    -StefanStefan Kleineikenscheidt#
  5. Hi Stefan. Here’s what I was using back then — and now:

    Eclipse v3.1.0
    MyEclipse v4.0 (now 4.0.3 GA)
    Maven 1.0.2
    Mevenide v0.9.0 (that’s the “Mevenide Core’‘ version)

    Hope that helps.Ben Poole#
  6. Me again, got it working. See here for a post about my journey and how I got it working eventually:

    http://www.kleineikenscheidt.de/stefan/archives/2005/12/installing-mevenide-in-eclipse-311.html

    Btw: I had to set the Java Home location to a proper JDK (not JRE) installation.

    Thanks for your post, anyway.
    -StefanStefan Kleineikenscheidt#

Comments on this post are now closed.

About

I’m a software architect / developer / general IT wrangler specialising in web, mobile web and middleware using things like node.js, Java, C#, PHP, HTML5 and more.

Best described as a simpleton, but kindly. You can read more here.

";