Maven (1): Why learn Maven

1. What is Maven?
Maven is a cross-platform project management tool, mainly serving Java platform-based project construction, dependency management and project information management.

2. What benefits can Maven bring to me?
2.1. Save the time we spend on tedious construction operations such as cleaning, compiling, running unit tests, generating documents, packaging and deployment every day, maven only needs one command mvn clean install and it will be done automatically for us.
2.2. Cross-platform, the same operation command can be used no matter on windows, linux or mac
2.3, the duplication of construction is eliminated

3. What other tools are similar to him, and which aspects of maven are stronger? (Why choose maven)
Other build solutions are IDE, Make and Ant etc.
     IDE can greatly improve our development efficiency. The current mainstream Eclipse and NetBeans provide powerful text editing, debugging and even refactoring functions, but IDE has its inherent defects, it needs to rely on a lot of manual operations, compilation, Testing, code generation, etc., it is difficult to complete most of the work with one click. Another problem is that a code that can run successfully on machine A may fail when ported to the IDE of B. We should use the IDE reasonably. , use its advantages to abandon its shortcomings, the current mainstream IDEs have integrated Maven   
    Make may be the earliest build tool. It is unknown and has not been used before. The power of Make is that it can use the local commands of all systems, especially UNIX/Linux systems. Rich functions and powerful commands can help Make gets things done quickly and efficiently. However, Make binds itself to the operating system. That is to say, with Make, it is impossible to achieve (at least difficult) cross-platform builds, which is very unfriendly to Java. In addition, the syntax of the Makefile is also problematic, and many people complain that the reason for the failure of the Make build is often a hard-to-find space or tab usage error.  
    Ant is a java-based cross-platform. Like Make, Ant is procedural, where the developer explicitly specifies each target and the tasks that need to be performed to complete that target. For each project, developers need to rewrite this process, which implies a lot of repetition. Maven is declarative. The project construction process and the work required at each stage of the process are implemented by plug-ins, and most of the plug-ins are ready-made. The developer only needs to declare the basic elements of the project, and Maven will perform a built-in and complete build. Process. This largely eliminates duplication. Ant has no dependency management, so Ant users have to manually manage dependencies for a long time, which is a headache. Fortunately, Ant users can now manage dependencies with the help of Ivy. For Maven users, dependency management is a matter of course. Maven not only has built-in dependency management, but also has a central repository that may have the most Java open source software packages in the world. Maven users can enjoy it directly without any configuration.

4. What are the shortcomings of maven?
4.1. The support for IDE is poor, there are many bugs, and it is not very stable (maven is still relatively young, this is a necessary process)
4.2. Maven is too complicated, it is the EJB2 of the build system. (Maven is used to manage projects, and the process of cleaning, compiling, testing, packaging, publishing and some customization is itself a complicated thing, and the Java community is still There is no more powerful and simpler tool than maven, so we should try to help maven make it easier instead of abandoning it)
4.3, less documentation (I'm still young and need everyone's help)


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326773289&siteId=291194637