本地jar包添加至Maven仓库

Maven命令将本地的jar包方放到maven仓库中

       //自定义本地的jar包在pom文件的参数
     <dependency>
            <groupId>com.eee</groupId>
            <artifactId>youzan</artifactId>
            <version>2.0.4</version>
        </dependency>

命令:mvn install:install-file -Dfile=jar包的真是绝对位置 -DgroupId=groupId(pom中的groupId) -DartifactId=artifactId(pom中的artifactId) -Dversion=version(pom中的version) -Dpackaging=jar

例如:mvn install:install-file -Dfile="D:\machine\src\lib\open-sdk-java-2.0.4-SNAPSHOT.jar" -DgroupId=com.eee -DartifactId=youzan -Dversion=2.0.4 -Dpackaging=jar

  将项目lib文件夹中的open-sdk。jar包放到maven仓库中引入

  效果:

  

  成功导入至本地仓库中!