Hello, I would very much like to know, I revised and re-read a lot, but I can not understand. Why do you need Maven, if you have an IDE - Eclipse, Netbeans, etc.? What is its advantage in assemblies if and IDE cope?

  • 3
    The IDE does it if you have a small pocket project. As soon as you want to connect external dependencies, set up auto-testing, divide the assemblies into test / industrial, etc. - here that enlightenment will come. If we draw an analogy, it is like the difference between the assembly of the boxes on the conveyor of the aunt Klava and the assembly of the Mercedes on the robotic line. - rjhdby
  • 2
    If they do it, then you don't need it yet. The main advantage of maven dependency management is vp_arth
  • And yes, look at the gradle right gradle , he is trendy, youthful - rjhdby
  • Well, yes) and Grovy to master the bargain - GoodRA
  • 2
    @vp_arth yes even make . With gredlom it will be easier to move to android, if that. And in general, well, objectively, gradle will be much better. Generally holivor of course, so I suggest not to develop :) - rjhdby

2 answers 2

Not quite a correct question, you can not compare Maven and the development environment. C Maven can work without development environments. Why do you need? To manage dependencies, to build projects, and for a heap of everything else useful. For example, you write a big project and use many technologies in it, for example, Hibernate, JUnit. The question arises how to connect all the libraries? The answer is simple - just write dependencies in pom.xml, and maven will download them for you. Then such a situation is possible, you want to show the project to a friend, send it to him, but the problem is, if this is not a Maven project, then your friend will have to download libraries to make the project work, and Maven will do it for him. With the growth of your projects, you yourself appreciate the merits of maven. IDEs cope - and if there is no IDE on your computer? What will you do? Maven comes to the rescue, it is cross-platform and there is enough command line to work with it.

  • one
    I will add the main answer. IDE use systems, Ant, Maven, Gradle - Bogdan Panchenko
  • one
    In my opinion, to theorize about situations “when there is no IDE on your computer” is about how to theorize about situations when you have no electricity in your apartment. - Artem Ionash

The IDE is able to build a project, but each does it differently - it uses a different java version, encoding, project structure, external libraries are in different places and may have a different version.

Maven and other build systems are used to unify this process. They have a number of advantages:

  • with their help, versions of libraries are indicated, and what is not unimportant, the system knows where to get them from.
  • It has a well-established project structure, it avoids confusion and makes it easier to find what you need.
  • has a certain set of steps - compilation, testing, packaging, and so on.
  • ability to customize the build process - add additional steps
  • assembly does not depend on the IDE, operating system, etc., because You can specify the compiler version, encoding, etc.