Maven_installation and warehouse classification_hehe.employment.over.24.2

24.4 Maven_Download and Installation

24.4.1 Download of Maven software

24.4.2 Installation of Maven Software

  • After downloading, unzip Maven to a path with no Chinese and no spaces, such as: D:\CodeSoft\Source_File
  • Icon after decompression:
    Insert picture description here
  • bin : storedmaven command, Such as the mvn tomcat:run we used earlier;
  • boot : some storedmaven's own bootloader, Such as class loader, etc.;
  • conf : storedSome configuration files of maven, Such as the setting.xml file;
  • lib : storedSome jar packages needed for maven itself to run

24.4.2 Maven environment configuration

Insert picture description here
Insert picture description here

24.4.3 Maven software version test

  • command: mvn -v

Insert picture description here

24.5 Maven_Warehouse

24.5.1 Warehouse Classification

  • The work of maven needs to download some jar packages from the warehouse. As shown in the figure below, the local project A, project B, etc. will download the jar package from the remote warehouse (which can be understood as the warehouse on the Internet) through the maven software and store it in the local warehouse. It is the local folder. When the jar package is needed for the second time, it will no longer be downloaded from the remote warehouse. Because the local warehouse already exists, the local warehouse can be understood as a cache. With a local warehouse, there is no need to download it from the remote warehouse every time. .

Insert picture description here

  • Local warehouse: used to store plug-ins and jar packages downloaded from remote warehouses or central warehouses. The project uses some plug-ins or jar packages. The default local warehouse location is first found from the local warehouse
    ${user.dir}/.m2/repository, which${user.dir}represents the windows user directory.
  • Remote warehouse: If a plug-in or jar package is needed locally, but the local warehouse does not, it will download from the remote warehouse by default. The remote warehouse can be in the Internet or in the local area network.
  • Central warehouse: A remote warehouse address http://repo1.maven.org/maven2 is built in the maven software. It is a central warehouse and serves the entire Internet. It is maintained by the Maven team itself and stores a very complete jar package. , It contains most of the popular open source project components in the world.

24.5.2 Maven local warehouse configuration

  • The location of the maven_repository local warehouse:
    • D:\CodeSoft\Install_File\maven_repository\maven_repository
      Insert picture description here
  • Configure the local warehouse location in the MAVE_HOME/conf/settings.xml file (under the maven installation directory):

Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_44686266/article/details/113854902