[Maven] maven introduction, maven Introduction
Maven
Java Community standard project management tools. Maven is a cross-platform project management tool. As a successful open-source project organized by Apache, it mainly serves to build projects on the java platform and manage dependencies and project information.
Main features: automatic building, dependency management, and Project Information Management
Foolproof, highly automated, one-step building
Automatically download relevant jar packages for centralized dependency management
- Project information management
Project information, developer information, developer information, and documentation are automatically generated
Why Maven?
Ant |
Maven |
No agreed directory structure |
Have a clearly agreed directory structure |
You must specify what ant will do, when to do it, and then compile and package it. |
You only need to define a pom. xml file and place the source code in the default directory. Maven automatically handles other tasks. |
No integration dependency management |
Dependency management and warehouse management |
Maven installation and configuration
Maven is a java project. Make sure that JDK is installed.
Environment variable:
JAVA_HOME = D: \ env \ jdk1.6
MAVEN_HOME = D: \ env \ apache-maven-3.0.5
PATH =; % MAVEN_HOME % \ bin; % JAVA_HOME % \ bin
Check whether maven is successfully installed:
Mvn-v (or version)
Initialize Configuration
Set MAVEN_OPTS Environment Variables
-Xms128m –Xmx512m
When maven is used, if a memory overflow is reported, if mvn site is used to consume a large amount of memory, modify the Default Configuration:
Maven installation directory \ bin \ mvn. bat-> at @ REM set MAVEN_OPTS = ...... Add later
set MAVEN_OPTS= -Xms128m -Xmx512m