搭建maven环境

mac2022-06-30  71

下载maven

maven.apache.org

设置环境变量:

 D:\maven\apache-maven-3.2.5\conf\settings.xml修改maven仓库的位置(默认在:Default: ${user.home}/.m2/repository),修改到另外一个目录中

<localRepository>D:/maven/repo</localRepository>

 D:\maven\apache-maven-3.2.5\lib\maven-model-builder-3.2.5.jar,打开并查看pom-4.0.0.xml文件,

<repositories> <repository> <id>central</id> <name>Central Repository</name> <url>https://repo.maven.apache.org/maven2</url> 下载文件的中央工厂url <layout>default</layout> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories>

测试maven配置是否成功打开命令行窗口,输入mvn -v,如果有maven 版本信息输出则证明配置成功,否则请查看自己配置路径等是否正确。

注意:安装maven前请确保已安装JDK并成功配置其环境变量。

转载于:https://www.cnblogs.com/qiyebao/p/4444464.html

最新回复(0)