简体   繁体   English

从任何项目外部将Maven工件安装到本地存储库中

[英]Installing Maven Artifacts Into a Local Repository From Outside Of Any Project

有没有办法在不先创建和切换到项目并将该程序包指定为其依赖项之一的情况下,将任意Maven工件安装到本地存储库中?

Yes, if you have the jar file of the artifact that you want to install to your local repository, you can the run the below command from your command prompt or terminal. 是的,如果您具有要安装到本地存储库的工件的jar文件,则可以从命令提示符或终端运行以下命令。 Replace the value inside the angle brackets to your desired ones. 将尖括号内的值替换为所需的值。 And then you can use this as a dependency in your Maven projects. 然后,您可以将其用作Maven项目中的依赖项。

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

HTH HTH

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

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