Preparations for using Maven for Development Process Management

Source: Internet
Author: User
I. Problems

 

As a new developer, Luo shuquan, an IT male, entered the first software project in his career. The development technology he learned on a daily basis can come in handy. The entire project team encountered many problems in the cooperation process:

 

1. it male Luo shu pulled all branches from SVN and prepared to import the development environment. The result failed. I found that my development environment is different from the company environment.

2. It male Luo shu is fully writtenProgramThe database cannot be connected. After finding many configuration files, you can find that a configuration item of your own is faulty.

3. Unable to generate a report for the overall unit test and observe the overall project.

4. It male Luo shu is updating many othersCodeThen it took a long time to locate the problem.

5. The program of it male Luo shuquan was obviously changed, but the result is the same as before. It is true that the program has been released. Later, it was found that the program depends on two versions of a jar package, and the previous version was first loaded.

6. Check the code style. It takes a long time for the standards to be followed and there is a network leakage.

 

Ii. Basic Concepts

 

Maven is a tool for project management. It manages the dependencies between parts and parts, defines the life cycle with built-in definitions to define the stage of project management, and provides a framework for inserting plug-ins in various stages.

 

1. lifecycle management:

| Concept:

 
   


1. lifecycle: abstracts the software development process and divides it into different stages. Call the bound plug-ins at different stages to solve specific problems.

 

2. Plugin: a set of functions that need to be done in the process. For example, verify file layout, file style, generate coverage report, and package.

 

3. Goal: The functions that need to be done during development. Such as packaging.

 

L goals:

The Development Manager can crop the desired lifecycle and bind the functions required for the lifecycle, such as packaging, generating reports, and verifying project specifications, to the corresponding stage through plug-ins. In different locations, let the lifecycle repeat to ensure the consistency of the development process and requirements and the repeatability of the results.

Its core is to maintain the project lifecycle, and in the cycle, according to the POM configuration, you can call the corresponding configurable plug-ins to Implement the work that needs to be done in the phase, in addition, the target bound to the first cycle is called during the running cycle.

 

2 dependency management:

 

L concept:

1. component (artifact): a component is an abstraction of a reusable unit. In Java, it can be a jar package or a war package, or a DLL in C ++. In Maven, each component (artifact) has a unique identifier, which consists of three elements: groupid, artifactid, and version.

 

2. Dependency: A dependency that requires another component to operate. All dependencies of a component are described by the dependency node of the POM file.

 

L goals:

Scan the POM at runtime and obtain the corresponding dependencies. Then, extract the dependencies of each dependent part and form a dependency tree.

 

L solved problems:

 

Increase reusability: Make code that can be reused into parts, increase reusability, reduce coupling, and reduce maintenance costs.

Discovery of circular dependency: Circular dependency will result in the inability to reuse any parts in the circular dependency and the expansion of local problems.

Solve the jar hell problem: it is found that the dependency tree depends on different versions of a part at the same time. For Java, only one class with the same full name of the two jar packages is loaded, resulting in the difference between the running results and the expected results. The structure can be found and solved in advance.

 

Recommended books:

1. MAVEN books: Maven practice -- Xu xiaobin

2.21 jolt awards-development process methodology: continuous delivery: system methods for releasing reliable software

References:

Introduction to Apache maven2

 

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.