Home>Article>Java> What is maven in java

What is maven in java

little bottle
little bottle Original
2019-05-22 16:02:43 17172browse

In Java, maven is a cross-platform build tool, a dependency management tool and a project management tool; a tool that can be used to build and manage Java-related projects. The benefits of using Maven to manage projects: the project structure is the same, which facilitates unified maintenance of jar packages.

What is maven in java

Maven is a top-level project of Apache. Its emergence is increasingly affecting many open source projects today. Not only that, many new projects of many companies All are managed using the method advocated by Maven. After talking a lot, let’s talk about the key point: what is maven in java?

Maven is a cross-platform build tool

It serves the build and is an extremely powerful build tool that automates the build process (from cleaning, compilation, testing to Generate reports, then package and deploy. As long as Maven configures the project, enter simple commands such as: mvn clean install to complete a series of operations), which maximizes the elimination of duplication of builds and abstracts a complete build life cycle model. It is cross-platform, provides a consistent operating interface to the outside world, and standardizes the construction process.

Maven is a dependency management tool and project management tool

Accurately locates each component (artifact) through a coordinate system;

Derived from Maven Tools (such as Nexus) can quickly locate open source libraries and help automatically download them. Maven's project structure, test case naming method, etc. have already set rules. As long as you follow the rules, users will save extra time when switching between projects - Convention is better than configuration

maven contains Here are:

A project object model (Project Object Model), a pom.xml for a project

A set of standards,

A project life cycle (Project Lifecycle),

a dependency management system (Dependency Management System),

and the logic used to run the plugin goals defined in the lifecycle phases.

When you use Maven, you describe your project with a well-defined project object model, and Maven can then apply cross-cutting logic from a set of shared (or custom) plugin.

There are two main benefits of using Maven to manage projects:

One is that Java projects managed by Maven all have the same project structure. There is a pom.xml used to maintain which jar packages are used in the current project; all java codes are placed under src/main/java; all test codes are placed under src/test/java.

What is maven in java

#The second is to facilitate unified maintenance of jar packages.
Maven-style projects put all jar packages in the local "warehouse", and then which project needs to use this jar package, just give the name and version number of the jar package, and that's it. Jar package sharing is provided to avoid the trouble caused by each project having its own jar package.
As shown in the figure below, the pom.xml file declares the jar package version required by the project.

What is maven in java

The above is the detailed content of What is maven in java. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:what is java me? Next article:what is java me?