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

Introduction to the installation and use of Maven

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

The main content of this article is "introduction to the installation and use of Maven". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "introduction to the installation and use of Maven".

Maven is an automated build tool that serves the Java platform and is mainly used for project build and dependency management.

Install and configure the environment variable # to see if jdkjava-version is configured

1. Download maven, take the win operating system as an example

two。 Extract to the specified directory

3. Configure the Maven environment variable and verify that the configuration is successful

# use this command to verify that mvn-v is configured successfully

4. Configure the local warehouse and the Ali mirror source

Edit this file to add the location of your local warehouse

Configure Ali maven mirror source to improve dependent download speed

Alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central

5. To find maven dependencies, you can search at maven's central warehouse.

Https://mvnrepository.com/

6. Direct dependence and indirect dependence

A depends on BPerry B depends on C, which belongs to direct dependence, while A dependence on C belongs to indirect dependence.

7. Dependent range

Compile: compile scope, default package of this scope, can be used by classes under main and test: participate in deployment of test: test scope package, value is used for classes under test directory, classes under main are not available: do not participate in deployment provided: provide scope package, can be used for classes under main and test: do not participate in deployment...

8. Transitivity of dependence

The range of compile is transitive, while the range of test and provided is not.

9. Dependency transitivity: resolving jar package conflicts

The shortest ① path is preferred.

The first declaration takes precedence when the ② path is the same (the declaration refers to the order in which the dependency tags are configured)

10. Dependency exclusion

Org.springframework.boot spring-boot-starter-security org.springframework.boot spring-boot-starter

11. Uniformly manage the version of the target jar package

# Global variable declaration, you can declare version number 3.3.2 com.baomidou mybatis-plus-boot-starter ${mybatis-plus.version}

twelve。 Inherit

Org.springframework.boot spring-boot-starter-parent 2.1.16.RELEASE com.baomidou mybatis-plus-boot-starter ${mybatis-plus.version} # B Project inherits Project A # through inheritance relationship, it is recommended that the dependent version and dependency scope com.rhynie.xxx A 1.0.. / pom.xml be managed by the parent project.

13. Polymerization

# aggregation: any operation on the current project, the aggregated project will do the same operation (usually placed in the parent project) A so far, I believe you have a deeper understanding of "introduction to the installation and use of Maven". You might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Internet Technology

Wechat

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

12
Report