注: 最好别通过eclipse做操作[可能会报错],可直接进入cmd命令行执行.
mvn install:install-file -DgroupId=com.xxx -DartifactId=xxxx -Dversion=1.0.0 -Dpackaging=jar -Dfile=d:\xx.jar
-DgroupId : groupId
-DartifactId : artifactId
-Dversion : 版本号
-Dpackaging : 本地jar包路径
执行成功pom引用如下:
<dependency>
<groupId>com.xxx</groupId>
<artifactId>xxxx</artifactId>
<version>1.0.0</version>
</dependency>