最近在学习thingsboard,需要安装maven,我根据网上找到的教程安装maven,结果命令行提示如下:
'mvn' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
我继续搜教程,都是一样的方法,我不知道哪里出了问题,
在China Thingsboard群里,我看到一个大佬分享了精简安装的教程,
maven部分安装,在解压了文件、编辑环境变量之后,
需要在maven里添加阿里镜像,打开apache-maven-3.5.4\conf\setting.xml
在如下图位置处添加镜像:
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
<mirror>
<!--This is used to direct the public snapshots repo in the
profile below over to a different nexus group -->
<id>nexus-public-snapshots</id>
<mirrorOf>public-snapshots</mirrorOf>
<url>http://maven.aliyun.com/nexus/content/repositories/snapshots/</url>
</mirror>
添加完成之后,再打开命令行界面,输入“mvn -v”,maven安装成功。