Installation, configuration and use of Maven

First of all: what is maven?

Maven is the project's construction tool, written in Java, so it is used in conjunction with Java.

Function: Create projects, write frameworks, write projects, quickly create projects, and must have a network, manage jar packages, have plug-in support, and automatic packaging and other functions.

Where can I download such a good thing?

Maven – Download Apache Maven

Of course it is here.

After downloading, we need to configure the system environment variables.

In the same way, press the win key on the keyboard, enter and edit the system environment variable

click open

Click on Environment Variables

Click the path in the system variable and double-click.

 

 Put the bin file path in.

Then we open the downloaded maven and go in to take a look.

 Introduce these folders,

bin: the executable file of the software

boot: Put the external required jar packages and plug-ins

conf: configuration file

lib: The jar package for personal use, don't touch it

reop: It is a folder between me, which is equivalent to a private warehouse

Then the second step: set up maven

Open the conf folder and open settings.xml

The first step is to create a repo private warehouse folder.

Then wrap the path to your reop with <localRepository> tags.

Step two:

warehouse service

Go to this URL and copy this passage

Then put it in the middle of <mirrors></mirrors>

 Like this, then maven is set up.

Then let's try to create it in the idea. Open our modus operandi.

There are two creation methods, let’s demonstrate them one by one.

 

Then right-click add framework support, assuming to be a web page, select web application

 Then click pom, pom.xml in the upper left corner

Add the jar package you want in the pom

Click m in the upper right corner to add this package. 

 

 When he downloads it, he will not report an error.

The red is gone. 

 There are functions that come with maven here.

Then we click on the settings in the file

Find this and modify it to the maven you downloaded

 ok, this is the end

Guess you like

Origin blog.csdn.net/makabaka12138/article/details/126115143