maven project, how to import local jar package

maven项目导入本地jar包,然后以pom坐标的方式引入项目。
  1. Why is there such a strange demand?
maven 上找不到了对应的jar包了,没有对应的坐标。
  1. Import method
将你本地的项目放入maven仓库,使用maven命令。而不是简单的复制进maven仓库。
  1. Parameter description, -Dfile=the path of your local jar package, -DgroupId=the group name you took, as the distinction of the warehouse project name, DartifactId=the project name under your group. The groupId and artifactId names can be taken as long as you can distinguish them. The path of your local jar package must be correct.
mvn install:install-file -Dfile=D:\smartupload.jar -DgroupId=sm -DartifactId=smartupload -Dversion=1.0 -Dpackaging=jar

    <dependency>
      <groupId>sm</groupId>
      <artifactId>smartupload</artifactId>
      <version>1.0</version>
    </dependency>

Guess you like

Origin blog.csdn.net/qq_44783283/article/details/108174642