maven download and installation steps in java

  • 2021-08-16 23:45:35
  • OfStack

When using the java project, without detailed management and auxiliary processes, it will be like the program losing the deployment of the system. In java, there is a special project management tool called maven, which not only has its own management functions, but also has detailed procedures to operate. What this article will bring to you is the download method of maven. Let's take a look at the specific installation method of this tool.

1. Introduction of maven

Maven is a software project management tool based on the Project Object Model (POM project object model) that manages the build, reporting, and documentation of a project through a small piece of description information (configuration). It is a management and construction tool specially built for java project.

2. Characteristics

Provides a set of standardized project structure;

Provides a set of standardized build processes (compile, test, package, release...);

A set of dependency management mechanism is provided.

3. Download address of maven

http://maven.apache.org/

Click download on the left, select the corresponding version to download on the jump page, select apache-maven-3. 3.9-bin.zip version, and decompress it directly after downloading to obtain apache-maven-3. 3.9.

4. Introduction to the Download Directory

bin: maven Run the scripts folder and execute commands on the command line to invoke scripts under that folder.

boot: A framework containing a class loader that maven uses to load its own class libraries.

conf: Configuration file directory, including the famous settings files.

lib: Class libraries and dependencies required for maven to run.

Content extension:

Maven advocates the use of a common standard directory structure, and Maven uses the principle that conventions are better than configuration. Everyone should abide by this directory structure as much as possible:

目录 目的
${basedir} 存放pom.xml和所有的子目录
${basedir}/src/main/java 项目的java源代码
${basedir}/src/main/resources 项目的资源,比如说property文件,springmvc.xml
${basedir}/src/test/java 项目的测试类,比如说Junit代码
${basedir}/src/test/resources 测试用的资源
${basedir}/src/main/webapp/WEB-INF web应用文件目录,web项目的信息,比如存放web.xml、本地图片、jsp视图页面
${basedir}/target 打包输出目录
${basedir}/target/classes 编译输出目录
${basedir}/target/test-classes 测试编译输出目录
Test.java Maven只会自动运行符合该命名规则的测试类
~/.m2/repository Maven默认的本地仓库目录位置


Related articles: