views:

531

answers:

3

I am not really familiar with Maven program but I've been using Eclipse for quite a while for Unit testing, code coverage, javadoc generation, code style checking, etc. Probably, the only main thing that I didn't really like about Eclipse is the "compilation errors" that it generates when you are running Eclipse and Ant simultaneously. So I am wondering if Maven 2 does the same thing if you are running Ant task.

Lee23

+1  A: 

The company I currently work for has a lot of JUnit tests which are run using Maven (1.x). We've never really had any problem and any tests that fail in maven can be debugged using the remote debugger or in Eclipse on their own.

The most important thing is that you take the time and effort to set up the environment properly so that when your tests run they are using the correct directories, variables, etc. This way you shouldn't get the 'compilation errors' that you would get when running Eclipse and Ant.

Maven has the ability to run all your tests for you during the testing cycle of compilation, this should stop the need for any Ant tasks to run the tests. However, if you still need to have scripts for other tasks (generation of code, etc) then be weary of Maven's ability to generate code and not include it in the compiled binaries (jar, war), though this may well be fixed for newer versions of Maven.

At the end of the day it would be best to evaluate Maven 2 and see if it's right for you. It sounds like you're having (sarcasm)a lot of fun (/sarcasm) with Ant and Eclipse already though. :)

PintSizedCat
+1  A: 

One of the main benefits of using maven is that you need to specify the dependencies, build-setup and deployment methods once, and then you can run them in multiple environments.

In particular you can have your continuous integration/nightly build environment run these tasks simply by using the pom.xml file.

Moreover, you can (and probably should) add the pom.xml file to your version control repository. This has two benefits: a) You keep track of how the build procedure changes between versions, and b) Other developers don't need to manually find and install all the JAR files that your project depends on, they simple fetch the POM file and maven takes care of the rest.

Einar
A: 

If you are working with tests and code coverage tools allready, you should look into maven. Especialy if you start to work with a project team.

Running tests in eclipse is fine as long as you are the only developer. Using maven will enable you to use continuous intregration tools like continuum

It might seem you have to invest more time in setting up maven correectly, but it wil ldefinetly pay of fin the long run.

We use continuum here, and we have never seen any problems with compilation errors, as soon as the system was setup corectly.

HuibertGill