索引:
参看代码 GitHub:
一、Linux (DeepinOS) 环境
1.官网下载
1 https://maven.apache.org/download.cgi
2.解压
1 tar -zxvf apache-maven-3.5.3-bin.tar.gz -C /home/liumeng/dev/Maven/
3.配置环境变量
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 仓库地址
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.生效
1 . ~/.profile
6.验证
1 mvn -v
蒙
2018-05-23 22:05 周三