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

The structure of Maven Wrapper and the method of downloading and using it

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains the structure of Maven Wrapper and the method of downloading and using it. The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn the structure of Maven Wrapper and the method of downloading and using it.

Brief introduction

It is necessary to use maven or gradle to develop java projects, and maven may be more common than gradle. To use maven, it is necessary to install maven. What if some users do not want to install maven? Or users do not want to install maven globally, so you can use project-level Maven Wrapper to achieve this functionality.

If you use IntelliJ IDEA to develop a Spring boot project, and if you choose to create a project from Spring Initializr, Maven Wrapper will be automatically applied in the project. To put it simply, there will be two more files under the project directory: mvnw and mvnw.cmd.

The structure of Maven Wrapper

Mvnw is the startup file of the Linux system.

Mvnw.cmd is the startup file of the windows system.

This article will not explain the internal information of the startup file in detail, interested partners can study it on their own. In addition to these two startup files, a hidden folder of .mvn is generated in the project. As shown in the following figure:

Image

Let's take another look. Mvn/wrapper/maven-wrapper.properties:

DistributionUrl= https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip

WrapperUrl= https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

This file specifies the versions of maven and maven wrapper.

Download Maven Wrapper

If we don't use IntelliJ IDEA, how can we download Maven Wrapper?

Under the home directory of the program:

Mvn-N io.takari:maven:wrapper

To specify a maven version:

Mvn-N io.takari:maven:wrapper-Dmaven=3.5.2

-N means-non-recursive, which will only be downloaded once in the home directory.

Use

The use of Maven Wrapper is the same as the maven command, such as:

. / mvnw clean install

. / mvnw spring-boot:run

Thank you for your reading, the above is the content of "the structure of Maven Wrapper and the method of downloading and using". After the study of this article, I believe you have a deeper understanding of the structure of Maven Wrapper and the method of download and use. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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