jar 打包到本地maven仓库中

落日映苍穹つ 2023-02-26 10:22 101阅读 0赞

一、打包命令

1.1 命令说明

注意:

  • 在window中使用cmd,不要使用PowerSheell
  • jar包路径中不要带中文。

    安装指定文件到本地仓库命令:mvn install:install-file

    Dfile 设置该jar包文件所在的路径与文件名

    mvn install:install-file -DgroupId=xxxx.xxx.xxx -DartifactId=xxx-xxx-xxx -Dversion=xxx.xxx.xxx -Dpackaging=jar -Dfile=E:\xxx\xxx\xxx.jar

二、添加依赖

  1. <dependency>
  2. <!-- 对应DgroupId 仓库的包名-->
  3. <groupId>xxxx.xxx.xxx</groupId>
  4. <!-- 对应DartifactId 所属的模块名-->
  5. <artifactId>xxx-xxx-xxx</artifactId>
  6. <!-- 对应Dversion 包的版本号-->
  7. <version>xxx.xxx.xxx</version>
  8. </dependency>

发表评论

表情:
评论列表 (有 0 条评论,101人围观)

还没有评论,来说两句吧...

相关阅读