Use of Maven

1. Maven

1.1 What is Maven

Maven is a project construction tool. As long as the created project follows the Maven specification, Maven can be used for management: compilation, packaging, etc.

1.2 The use of Maven

① Open IDEA -> New Project

insert image description here

② Select Maven all the way to Next

insert image description here
insert image description here

③ Search Mysql in the Maven repository

Maven repository
insert image description here

④ Find the version number that matches your own MySQL.

insert image description here

⑤ Copy it to pom.xml and wrap it with the dependencies tag.

insert image description here

⑥ Find Maven on the right side of IDEA and click Refresh

insert image description here
After it is not marked in red, it means that it has been downloaded.

⑦ Test code in Java. The following indicates success.

insert image description here

⑧ Packing

insert image description here
If you want to type other packages, you can <packaging>war</packaging>enter it here.

⑨ When you see BUILD SUCCESS, it means the packaging is successful

insert image description here
The target directory is the packaged jar package
insert image description here
. If you want to change the name, you can use these tags
insert image description here

1.3 Explain the project in Maven.

insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/wwzzzzzzzzzzzzz/article/details/124361889