Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Maven

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of how to use Maven, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how to use Maven. Let's take a look at it.

1. Introduction

You can find this tutorial, which shows that you are interested in Maven, but you don't quite understand it. Then the next series of tutorials will explain the use of Maven in detail. I'm sure you can have a better understanding of Maven after reading it.

2. Problems existing in conventional project development.

Usually, Web project development will create only one project, and then all jar packages will be stored in the WEB-INF/lib directory, as shown in the following figure:

From the above directory structure, we can analyze the following problems:

①, a project is a web project. If the project is relatively large, then using the package name package to divide the module is obviously easy to cause confusion and is not conducive to division of labor and cooperation.

②, the jar package needed in the project must be manually copied and pasted into the WEB-INF/lib directory. This will result in repeated copying of jar packages to the lib directory every time a new project is created, resulting in a large number of duplicate files in the workspace

③ and jar need to be downloaded manually on the official website or through other channels.

④, another jar package on which a jar package depends, needs to be added to the project manually, and it is quite possible that we missed a dependency, causing the project to run with an error.

So how to solve these problems? The protagonist Maven of this series arises at the historic moment.

3. What is Maven?

The pronunciation of Maven is [bad mev words], that is, "bad language", not "Marvin". It is a project management and integration tool, and Maven uses a standard directory structure and default build lifecycle. It provides developers to build a complete life cycle framework, and the development team can automatically complete the infrastructure construction of the project. I believe that if you don't know anything about Maven, you don't read this passage, but it doesn't matter, later we will gradually unveil the mystery of Maven. What is Maven, you just need to know that it can simplify and standardize the project construction process.

4. The history of Maven

Maven was originally designed to simplify the construction process of the Jakarta Turbine project. There are several projects, each containing a slightly different Ant build file. CVS detected in JAR. Maven developed by Apache organization can set up multiple projects, publish project information, and deploy projects.

5. The goal of Maven

The main goal of Maven is to provide developers

①, project is a comprehensive model that can be reused, easy to maintain, and easier to understand.

②, plug-ins, or interactive tools, this declarative mode.

The structure and content of the Maven project are declared in a XML file, pom.xml 's Project object Model (POM), which is the basic unit of the entire Maven system.

6. The concept of Maven

Agreement is better than configuration!

Developers do not need to create the build process itself and do not need to know the details of each configuration mentioned. Maven provides a reasonable default behavior for the project. When you create a Maven project, Maven creates the default project structure. The developer only needs to define the corresponding file and what she needs in pom.xml.

This is the end of the article on "how to use Maven". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to use Maven". If you want to learn more knowledge, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report