1.打开cmd窗口 输入并执行:
mvn install:install-file -DgroupId=com.test -DartifactId=ptest -Dversion=0.1 -Dfile=E:\test\test-0.1.0.jar -Dpackaging=jar
注:
DgroupId:pom.xml中的groupid
DartifactId:pom.xml中的artifactId
Dversion:pom.xml中的version
Dfile:jar包在本地中的路径
Dpackaging:包类型
2.打开要导入的maven工程中的pom文件:添加依赖如下
<dependency>
<groupId>com.test </groupId>
<artifactId>ptest </artifactId>
<version>0.1</version>
</dependency>