Maven导入本地Jar总结

导入命令:

mvn install:install-file

参数:

-DgroupId=包名  

-DartifactId=项目名  

-Dversion=版本号  

-Dpackaging=jar 文件打包类型 

-Dfile=path/xxx.jar 文件所在路径  

-DgeneratePom=true 为导入的文件生成pom文件

-DcreateChecksum=true 为导入的文件创建校验文件

举例:mvn install:install-file -Dfile=c:/path/xmlsocketutil.jar -DgroupId=xmlsocketutil -DartifactId=xmlsocketutil -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true

注意:以上的导入只是将文件导入到了你的本地仓库,

   如果你的公司配置了私服,则你还需要将该jar包发布到私服仓库中,使得其他的开发者或者工程可以共享

命令如下:

mvn deploy:deploy-file

-DgroupId=包名 

-DartifactId=项目名  

-Dversion=版本号 

-Dpackaging=jar

-Dfile=path/xxx.jar 文件所在路径

-Durl=私服地址

-DrepositoryId=仓库ID 如:thirdparty

原文地址:https://www.cnblogs.com/jack2013/p/4446693.html