Why do we need Maven or Ant, if we already have Eclipse?

ant, java, maven

Solution

- Because your collegue might prefer NetBeans or IDEA

- Because the settings might vary from one eclipse install to another

- Because you might want to get your dependencies automatically

- Because you want to automate the complete build: build, jar, apply static code analysis, run the unit tests, generate the documentation, copy to some directory, tune some properties depending on the environment, etc.

- Because once it's automated, you can use a continuous integration system which builds the application at each change or every hour to make sure everything still builds and the tests still pass...

- Because Maven uses convention over configuration.

- Because your IDE may not support some fancy code generation/transformation you need.

- Because a build script documents the build process.

Eclipse is a development environment. But it's not a build tool.

I personally hate Maven, but YMMV. There are many alternatives: gradle, buildr, etc.

Problem

I think this question is an extension of Compare to the IDE for Java,do we still need Ant? There are answers for the question above, but I wish to know a concrete example of using Maven or Ant over just Eclipse. When I develop in Eclipse, Eclipse does everything for me and I just need to click the run button. And also, Eclipse can let you export your code to a runnable jar or even .exe for windows. So I really don't know why I need Maven or Ant. And also if I do need, which one should I choose, Maven or Ant?

Original source

Related problems