11.2. Maven environment configuration

发布时间 : 2025-10-25 13:35:08 UTC      

Page Views: 10 views

Maven is a Java-based tool, so the first thing to do is to install JDK.

If you have not installed JDK, you can refer to our Java 开发环境配置 .

11.2.1. System requirements

Project

Request

JDK

Maven 3.3 requires JDK 1.7 or above

Maven 3.2 requires JDK 1.6 or above

JDK 1.5 or above is required for Maven 3.0

Memory

There is no minimum requirement

Magnetic disk

The installation of Maven itself requires approximately 10 MB space. In addition, the extra disk space will be used for your local Maven repository. The size of your local warehouse depends on usage, but expect at least 500 MB

Operating system

There is no minimum requirement

11.2.2. Check Java installation

Operating system

Task

Command

Windows

Open the command console

c:\> java -version 

Linux

Open the command terminal

# java -version 

Mac

Open the terminal

$ java -version 

11.2.3. Maven download

Maven download address: http://maven.apache.org/download.cgi

image0

Download the corresponding packages on different platforms:

System

Package name

Windows

Apache-maven-3.3.9-bin.zip

Linux

Apache-maven-3.3.9-bin.tar.gz

Mac

Apache-maven-3.3.9-bin.tar.gz

After downloading the package, extract it to the corresponding directory:

System

Storage location (can be configured according to your own situation)

Windows

E:Mavenapache-maven-3.3.9

Linux

/ usr/local/apache-maven-3.3.9

Mac

/ usr/local/apache-maven-3.3.9

11.2.4. Set the Maven environment variable

Add the environment variable MAVEN_HOME:

System

Configuration

Windows

Right-click “computer”, select “Properties”, then click “Advanced system Settings” and click “Environment variables” to set environment variables. The following system variables need to be configured:

New system variabl MAVEN_HOME , variable value: E:\ Maven\ apache-maven- 3.3.9

image1

Edit system variabl Path , add the variable value: ;% MAVEN_HOME%\ bin

image2

注意 Note that multiple values need to be separated by semicolons, and then click OK.

Linux

Download and decompress:

# wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz # tar -xvf apache-maven-3.3.9-bin.tar.gz # sudo mv -f apache-maven-3.3.9 /usr/local/ 

Editing /etc/profile File sudo vim /etc/profile To add the following code at the end of the file

export MAVEN_HOME=/usr/local/apache-maven-3.3.9 export PATH=${PATH}:${MAVEN_HOME}/bin 

Save the file and run the following command to make the environment variable take effect:

# source /etc/profile 

Enter the following command in the console. If you can see the relevant version information of Maven, it means that Maven has been installed successfully:

# mvn -v 

Mac

Download and decompress:

$ curl -O http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz $ tar -xvf apache-maven-3.3.9-bin.tar.gz $ sudo mv -f apache-maven-3.3.9 /usr/local/ 

Editing /etc/profile File sudo vim /etc/profile To add the following code at the end of the file

export MAVEN_HOME=/usr/local/apache-maven-3.3.9 export PATH=${PATH}:${MAVEN_HOME}/bin 

Save the file and run the following command to make the environment variable take effect:

$ source /etc/profile 

Enter the following command in the console. If you can see the relevant version information of Maven, it means that Maven has been installed successfully:

$ mvn -v Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00) Maven home: /usr/local/apache-maven-3.3.9 Java version: 1.8.0_31, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre Default locale: zh_CN, platform encoding: ISO8859-1 OS name: "mac os x", version: "10.13.4", arch: "x86_64", family: "mac" 
《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。