Translated as “expert” or “expert”, Maven is an open source project developed purely in Java under Apache. Based on the Project Object Model (POM) concept, Maven uses a central piece of information to manage the build, reporting, and documentation steps of a project.
Maven is a project management tool that allows you to build and manage dependencies on Java projects.
Maven can also be used to build and manage various projects, such as C#, Ruby, Scala, and other languages. Maven was a sub-project of the Jakarta project and is now an independent Apache project hosted by the Apache Software Foundation. As a piece of everyday software, there were a lot of unfamiliar places before. Today a little tidy up, if there is something wrong, you can leave a message.
Maven installation 1. Download Maven ZIP file 2. Configure MAVEN_HOME :(corresponding to Maven unzip address path) 3. Configure path:; %MAVEN_HOME%\bin 4. Check whether the installation was successful; Mvn-version, which displays the version of Maven
1. It is mainly divided into local (setting file under confg corresponding to local address) and remote (responselity corresponding to remote warehouse address).
< Settings > < LocalRepository > local directory directory
central repository
central
Central Repository
http://repo.maven.apache.org/…
default
false
Project is the project with the tag ModelVersion POM version model, 2.0 or 3.0 groupId project identifier, an organization or a project unique identifier, www.felixwang.site artifactId this is the name of the project, such as a personal website, Blogs and things like that. Groupid and artifactId together determine the location in the repository, version and this is the version number and there are three ways of packaging, jar, war, XdClass
demo
Maven’s three build lifecycles 1. Clean
2. Default validate the correctness of the project, compile the project code, compile the test, execute the test for the unit test framework Package Ȑ to install to localRepository (localRepository) to deploy to the remote repository, MVN package Maven MVN package MVN generate source code MVN compile MVN test-compile test code MVN package Maven compile test code MVN compile test code MVN package MVN compile test code MVN compile test code MVN test run test MVN verify check running MVN clean cleaning project MVN install installation project to a local warehouse MVN deploy publish the project to the remote warehouse MVN dependency: tree display Maven rely on the tree MVN dependency:list shows -d in Maven dependency list; -dmaven.test. skip=true skip unit tests; -p specifies the Profile configuration, which can be used to differentiate environments; The web related command MVN tomcat:run starts tomcat MVN jetty:run starts jetty MVN tomcat:deploy to run the package deployment