共计 803 个字符,预计需要花费 3 分钟才能阅读完成。
注意事项
- 先装好 jdk
Mac OS
$ tar -zxvf ~/dev/doc/apache-maven-3.5.4-bin.tar.gz -C ~/dev/tools/
$ mv ~/dev/tools/apache-maven-3.5.4/ ~/dev/tools/maven-3.5.4
$ ln -s ~/dev/tools/maven-3.5.4/ ~/dev/tools/maven
$ vim ~/.bash_profile
export M2_HOME=/home/user000/tools/maven
export PATH=$PATH:$M2_HOME/bin
$ source ~/.bash_profile
$ mvn -v
$ vim ~/dev/tools/maven/conf/settings.xml
配置默认 JDK 版本
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
阿里云镜像
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
正文完