Linux Maven installation and configuration

1. Download Maven (you can download to the specified directory. What I download here is my new folder / home / chuichuige / workspace / Development)

WGet ? ?bin. tar. gz


2. Unzip the specified directory (here I unzip it in the directory of / home / chuichuige / workspace / Development)

tar -zxvf{apache-maven-3.2.5-bin tar. GZ

3. Configure domestic sources (switch to the conf directory of Maven and modify the settings.xml file)

add the following contents to mirrors

& lt; mirror>& lt; id> nexus-osc id>& lt; mirrorOf>*& lt;/ mirrorOf>& lt; name> Nexus osc name>& lt; url> ;/ url>& lt;/ mirror>


modifying files may appear

“E45: ‘readonly’ option is set (add! To override)”

solutions can refer to:

4. Configure the environment variable “etc / profile”. Finally, add the following two lines

notes: maven_ The path behind home is the path of Maven after decompression

export Maven_ Home = / home / chuichuige / workspace / developep / apache-maven-3.2.5export path = ${path}: ${maven_home} / bin

5. Test (restart server test)

Input: MVN – V

test results are as follows

6. Location of local warehouse

default location: ${user. Home} / m2/repository

?windows:C:Documents and SettingsAdministrator. m2

?Linux:/root/. M2


size: 20.3 KB size: 39.3 KB view picture attachment

Related Posts