Linux 環境 Maven 安裝&倉源配置

索引:html

目錄索引git

參看代碼 GitHub:github

maven.txtapache

1、Linux (DeepinOS) 環境vim

  1.官網下載maven

1 https://maven.apache.org/download.cgi

  2.解壓url

1 tar -zxvf apache-maven-3.5.3-bin.tar.gz -C /home/liumeng/dev/Maven/

  3.配置環境變量spa

1 vim ./.profile
2 追加內容:
3 # maven 3.5.3
4 export M2_HOME=$HOME/dev/Maven/apache-maven-3.5.3
5 export MAVEN_OPTS="-Xms128m -Xmx1024m"
6 export PATH=$M2_HOME/bin:$PATH

  4.配置 maven 倉庫地址code

 1 文件:/home/liumeng/dev/Maven/apache-maven-3.5.3/conf/settings.xml
 2 修改內容:
 3       <mirror>
 4           <id>alimaven</id>
 5           <mirrorOf>central</mirrorOf>
 6           <name>aliyun maven</name>
 7           <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
 8       </mirror>
 9       <profile>
10           <id>jdk-1.8</id>
11           <activation>
12               <activeByDefault>true</activeByDefault>
13               <jdk>1.8</jdk>
14           </activation>
15           <properties>
16               <maven.compiler.source>1.8</maven.compiler.source>
17               <maven.compiler.target>1.8</maven.compiler.target>
18               <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
19           </properties>
20       </profile>

  5.生效xml

1 . ~/.profile

  6.驗證

1 mvn -v

 

 

 

                                         蒙

                                    2018-05-23 22:05 週三

相關文章
相關標籤/搜索