From the first time I heard about Maven, to the use of Maven (below)

From the first time I heard about Maven, to the use of Maven (below)

(Continued from the previous article)

Start a new maven project

One:

From the first time I heard about Maven, to the use of Maven (below)

The relationship between Project and Module is similar to the relationship between parent folders and subfolders, Module is a subfolder

You can put the project directly in the parent folder (Project), then there is no need for subfolders. Large projects need to be divided into modules, and Module is used

two:

Create the Project directly here: click next to this step, select the webapp in the picture (this option may take a while to load for the first time

From the first time I heard about Maven, to the use of Maven (below)

Then fill in groupid and artifactid

Groupid: Similar to the name of the company, generally fill in com.xx or org.xx

Artifactid: similar to the name of the department, usually fill in the name of the project yyy

Look at the picture below to understand the difference between the two: the From the first time I heard about Maven, to the use of Maven (below)following is built by myself:

From the first time I heard about Maven, to the use of Maven (below)

After clicking Finsh, it may take a while: the created maven project appears

From the first time I heard about Maven, to the use of Maven (below)

The most obvious sign of the Maven project is a pom.xml, open it

From the first time I heard about Maven, to the use of Maven (below)

Fill in here, the reference path mentioned in the previous article.

For example, you need spring-core.jar to go to this website
: http://mvnrepository.com/

Search for spring-core.jar maven and it comes out

From the first time I heard about Maven, to the use of Maven (below)

From the first time I heard about Maven, to the use of Maven (below)

From the first time I heard about Maven, to the use of Maven (below)

will

<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-core</artifactId>

<version>4.3.2.RELEASE</version>

</dependency>

This copy is placed under pom.xml

Under the dependencys node

From the first time I heard about Maven, to the use of Maven (below)

Well, as long as you click save, then he will go to the default path to find whether the package already exists, if it exists, then reference it, if it does not exist, download it, and then reference it. Then if you create a project next time, you don’t need to download it again if you use this package.

That's it for basic usage.

Thanks for reading! ! !

Guess you like

Origin blog.csdn.net/l1509214729/article/details/106579733