例如:pom.xml文件中想依赖本地jar包reportng-1.1.5.jar
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.5</version>
</dependency>
window命令行窗口执行以下命令:
mvn install:install-file -Dfile=D:\reportng-1.1.5.jar -DgroupId=org.uncommons -DartifactId=reportng -Dversion=1.1.5 -Dpackaging=jar
注意:
-Dfile是本地包所在路径
-DgroupId是pom.xml在的groupId
-DartifactId是pom.xml在的artifactId
-Dversion是pom.xml在的version