Maven Series Teaching Materials

Steps to use Maven


foreword

Recently, I found that many of the technologies I was proficient in before are rusty. From this point on, I will start to record some practical articles. If you like it, let’s start with Maven.

What is Maven

Maven is a tool dedicated to building and managing Java-related projects.

Maven is Yiddish, Yiddish (international language used by Jews), which means expert.

So use Maven to manage Java projects, you are an expert -_-!

Maven main use one: the same project structure top

Java projects managed with Maven all have the same project structure

  1. There is a pom.xml used to maintain which jar packages are used in the current project
  2. All java code is placed under src/main/java
  3. All test code is placed under src/test/java

Maven main use two: Unified maintenance jar package top

For example, there are 3 Java projects, none of which are maven style. Then these three projects will each maintain a set of jar packages. And some jar packages are the same.

For maven-style projects, first put all jar packages in the "warehouse", and then which project needs to use this jar package, you only need to give the name and version number of the jar package. In this way, the jar package is shared

As shown in the figure, in pom.xml, it indicates that the jar package of mysql is used, and the version number is 5.1.30.

So where is the warehouse? How to build it? In the follow-up tutorial will talk about: warehouse .

insert image description here

Guess you like

Origin blog.csdn.net/dissplay1/article/details/111240389