简体   繁体   English

如何将Maven本地存储库用作远程存储库?

[英]How can i use a maven local repository as a remote repository?

I want to change my local repository temporary and i also want to use my local repository as a remote repository. 我想临时更改本地存储库,也希望将本地存储库用作远程存储库。

I should be able to use mvn install -Dmaven.repo.local=temporaryDir and it should get the artifacts/dependencies from my local repository instead of downloading them again. 我应该能够使用mvn install -Dmaven.repo.local = temporaryDir,它应该从本地存储库中获取工件/依赖项,而不是再次下载它们。

您可以在settings.xml中将(旧的)本地存储库配置为存储库。

Try fidging around with your maven settings file. 尝试使用您的Maven设置文件进行查找。 Refer to this article to find it, uncomment/edit the tags with names like "repository". 请参阅本文以查找它,取消注释/编辑名称如“存储库”的标签。

(I found settings.xml in both {MAVEN_INSTALLATION_FOLDER}/conf/ and {USER_FOLDER}/.m2/ but I think is the last one to be applied. I guess you can find which one is on the settings of your IDE/project) (我在{MAVEN_INSTALLATION_FOLDER}/conf/{USER_FOLDER}/.m2/ {MAVEN_INSTALLATION_FOLDER}/conf/中都找到了settings.xml ,但是我认为这是最后一个要应用的。我想您可以在您的IDE /项目的设置中找到哪一个。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM