(1) preliminary understanding and understanding of Maven; preliminary understanding of maven

Source: Internet
Author: User

(1) preliminary understanding and understanding of Maven; preliminary understanding of maven

Apache Maven is a comprehensive tool for software project management. Based on the concept of the project Object Model (POM), it provides methods to help manage building, documents, reports, dependencies, and releases,

Maven simplifies and standardizes the project construction process. Seamless integration of compilation, assignment, documentation, team collaboration, and other tasks. Maven adds reusability and is responsible for creating related tasks.

 

The advantage of maven is that it can standardize, automate, improve efficiency, and provide powerful scalability for the project process. By using maven itself and its plug-ins, it can also obtain code check reports and unit tests.

Test Coverage, continuous integration, and so on.

 

The basic principle of Maven is very simple. It uses the remote warehouse, local warehouse, and a core configuration file pom. xml. the jar file defined in pom. xml is downloaded from the remote warehouse to the local warehouse,

Each project uses the jar of the same local repository. the jar of the same version only needs to be downloaded once, and every application must not copy the jar. At the same time, it adopts the current popular plug-in system architecture

The core of maven is very small. Only a few megabytes of files are required to automatically download the required plug-in when executing the maven task.

 

The concept model is as follows:

 

 

Maven officially defines maven as a project management tool. Next let's see what maven has done for our project management?

Project standardization:

Maven projects have a unified project structure, which is based on the best practices in the industry and lays the foundation for the use of unified maven commands, such as testing mvn test and packaging.

Mvn package and so on. You can easily implement multiple functions without writing a script.

Documents and reports:

Mvn site can be used to quickly generate a project site. Many open-source apache project sites use maven to generate the built by maven icon.

Class Library Management:

Class Library Management isMavenFor a core function, we need to add the class libraries that the project depends onPom. xmlMedium, thenMavenThe dependent class library is automatically downloaded to the local device.

If the class library is dependent on other class libraries, it will be automatically downloaded, so that we do not need to download one class library.

Release management:

Maven can be used for convenient project posting management. You can use mvn package to package a project at a certain stage of development. It automatically runs mvn test first and runs all Test cases.

Only after the application is approved can the package be correctly packaged. The generated war package (if the project packaging is war) is in the target directory. This war package is generated using the ant script, but no script is required. This is also the maven

One of the advantages of ant. Use mvn install to publish the compiled and packaged files to the local repository. Run mvn deploy in the integration or release environment to copy the package of the final version to the far

The repository of the process.

 

This series of blog posts aims to highlight important maven knowledge points and improve maven learning efficiency. If you have mastered these knowledge points, it is no problem to use maven. If you want

Maven friends who know about it are helpful. If you want to fully master maven, we recommend that you read "maven practice" written by Xu xiaobin.

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.