简体   繁体   中英

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. Replace the value inside the angle brackets to your desired ones. And then you can use this as a dependency in your Maven projects.

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

HTH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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