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

后端 未结 5 756
粉色の甜心
粉色の甜心 2020-12-22 17:39

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 ex

5条回答
  •  悲&欢浪女
    2020-12-22 17:43

    1. Because your collegue might prefer NetBeans or IDEA
    2. Because the settings might vary from one eclipse install to another
    3. Because you might want to get your dependencies automatically
    4. 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.
    5. 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...
    6. Because Maven uses convention over configuration.
    7. Because your IDE may not support some fancy code generation/transformation you need.
    8. 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.

提交回复
热议问题