在setttins.xml文件中找到<mirrors></mirrors>标签对,进行修改:
1 <mirrors>
2 <mirror>
3 <id>nexus-aliyun</id>
4 <mirrorOf>*</mirrorOf>
5 <name>Nexus aliyun</name>
6 <url>http://maven.aliyun.com/nexus/content/groups/public</url>
7 </mirror>
8 </mirrors>
自定义修改仓库的存储位置
可改变默认的 .m2 目录下的默认本地存储库文件夹
通过修改${user.home}/.m2/settings.xml 配置本地仓库路径 ,没有settings这个xml文件就新建,或者如下复制个。
具体就是修改如下的Xml代码
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository -->
<localRepository>C:\Users\fw\.m2\repository</localRepository>
<settings>
jar包放入本地仓库下
比如将F盘的aspose-words-16.4.0-jdk16.jar文件放到仓库路径下:
C:\Users\Administrator>mvn install:install-file -Dfile=F:\aspose-words-16.4.0-jdk16.jar -DgroupId=com.aspose -DartifactId=aspose-words -Dversion=16.4.0 -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true
其中:-Dfile是jar包所在的路径,-DgroupId是组名,-DartifactId是ID,-Dversion是版本号,关于组名、ID和版本号。