Maven - Introduction


chapter


Maven is a powerful build tool for Java projects, based on POM (Project Object Model) file that can be used to build the project, dependent on module management and Javadoc generation.

What is the build tool

Build software build process automation tool is a tool. Building a software project usually contains the following sections:

  • Generating source code (if used to automatically generate the project source code)
  • Generating a document from source code (e.g. Javadoc)
  • Compile the source code
  • The compiled code or ZIP package to package JAR package
  • The deployment of packaged file to the server or repository

Some software project may also contain other special building tasks that can be added to the build process in maven automated execution.

Build process automation benefit is to avoid making mistakes, more efficient, manual process of building relatively slow and error-prone.

Maven's official website

http://maven.apache.org

Maven can be downloaded from the official website

Installing Maven

Installation steps are as follows:

  1. Set the JAVA_HOMEenvironment variable, pointing to Java SDK (eg Java 8) installation directory.
  2. Download Maven and unzip to the specified directory, this directory is the maven installation directory.
  3. Set the M2_HOMEenvironment variable, pointing to the unpacked Maven directory.
  4. Set M2environment variables, point to the bin directory of the Maven extract the directory (on Windows %M2_HOME%\bin, on UNIX $M2_HOME/bin).
  5. Will M2add an environment variable to the PATH environment variable (on Windows% M2%, on unix as $ M2).
  6. Verify the installation, execute the command line mvn -version.

Execute mvn -versioncommand output maven if the version number is correct, the installation was successful.

Note: Depending on Maven Java runtime, the system needs to be installed Jdk (and JAVA_HOME environment variables) can not be used JRE, maven need to use the Java compiler, JRE is not included.

Guess you like

Origin blog.csdn.net/weixin_43031412/article/details/91890973