What Maven is, and why you should use Maven

Source: Internet
Author: User
Tags manual version control system
What Maven is, and why you should use Maven
Reference books (recommended to buy a physical book): "Maven Combat" (domestic first MAVEN works) (Maven installation, configuration and use of the introduction)

1. Overview
MAVEN is a build tool, service and build. After using MAVEN to configure the project, enter a simple command such as: mvn clean Install,maven will help us with those tedious tasks.
MAVEN is a cross-platform.
Maven maximizes the elimination of duplication of builds.
Maven can help us standardize the build process. All projects are simple and consistent, simplifying learning costs.
In short, MAVEN, as a build tool, not only helps us automate builds, but also abstracts the build process and provides a build-to-task implementation. He is a cross-platform, providing a consistent interface for operations, all of which makes him an excellent, popular building tool.
But Maven is not just a build tool, he's also a dependency management tool and project information management tool. He also provides a central warehouse that can help us to download components automatically.
There is also an added benefit to using MAVEN, which is that MAVEN has established rules for content such as project directory structure, test case naming, and so long as these mature rules are followed, users switch between projects with extra learning costs, which can be said to be better than configuration (convention Over Configuration).


2. Contrast, maven,ide,mark,ant
A.ide: Basically all the mainstream Ides are integrated with MAVEN, and we can run Mave in the IDE for easy execution. The IDE relies on a lot of manual manipulation. Compiling, testing, and code generation are all independent, and it's hard to do all the work with one click. Manual labor often means inefficiency, meaning error prone it is difficult to unify all IDE configurations in the project, and everyone has their own preferences. It is for this reason that a task that can run successfully on machine A May fail in the IDE of Machine B.
So, use the IDE properly, but rely on it more. MAVEN is an expert.

B.make may be the earliest building tools, specific unknown, not used, can not understand. The power of make is that it can take advantage of the local commands of all systems, especially the unix/linux system, with rich features and powerful commands that help make the task perform quickly and efficiently.
However, make binds itself to the operating system. In other words, using make makes it impossible (at least) to build cross-platform, which is very unfriendly to Java. In addition, Makefile's syntax is a problem, and many people complain that the cause of make build failure is often a hard-to-Find space or Tab usage error.


C.ant is meant to mean "another neat tool" (another Neat tools), which was first used to build the famous Tomcat, whose author James Duncan Davidson was motivated by the fact that he could not bear the makefile syntax format. We can look at Ant as a Java version of make, and that's because using Java,ant is cross-platform. In addition, Ant uses XML to define the build script, which is also more friendly than makefile.
Like make, Ant is also process-specific, and developers explicitly specify each goal and the tasks that are required to accomplish that goal. For each project, developers need to rewrite the process, and there is a lot of repetition. MAVEN is declarative, the work required by the project build process and every stage of the process is implemented by plug-ins, and most plug-ins are readily available, and developers only need to declare the basic elements of the project, and Maven executes the built-in, complete build process. This eliminates duplication to a large extent.
Ant is not dependent on management, so for a long time ant users have to manually manage dependencies, which is a headache. Fortunately, ant users can now manage dependencies with Ivy. For MAVEN users, dependency management is taken for granted, MAVEN not only has built-in dependency management, but also has a central repository of the world's most Java open source packages, and MAVEN users can enjoy it without any configuration.

3.Maven and Extreme Programming
Extreme Programming (XP) is an agile development approach ASB in the software industry in recent years, emphasizing embracing change.
First look at how MAVEN helps XP teams achieve some core value:
Simple MAVEN exposes a consistent, concise set of operating interfaces that can help team members get out of the original, highly customizable, complex build system, and use Maven's existing mature, stable components to simplify the complexity of building systems.
? Communication and feedback. When combined with a version control system, everyone can perform the latest builds and get feedback quickly. In addition, automatically generated project reports can help members understand the status of a project and facilitate team communication.


Maven can support almost any software development approach in a very good way.

For example, in the traditional waterfall model development, the project goes through the requirements development, analysis, design, coding, testing and integration release phase. Starting with the design and coding phases, you can use MAVEN to build your project's build system. In the design phase, it is also entirely possible to develop test cases for the design, and then write code to satisfy these test cases. However, with an automated build system, we can save a lot of manual testing time. In addition, the early use of the building System integration Team code, the project is also a benefit of no harm. Finally, MAVEN can help us publish projects quickly.

HTTP://HI.BAIDU.COM/ECHOLXL2010/ITEM/8A1981F0809A5E1BD7FF8CE3 Click to open link

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.