maven将本地jar加进本仓库


在项目中有时需要添加第三方jar到maven项目中,这时就可以使用mvn命令将jar添加到本地库中。

1
2
3
4
5
6
7
8

mvn install:install-file
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=<packaging>
-DgeneratePom=true

在你的项目pom.xml中添加依赖

1
2
3
4
5
<>
<groupId> group-id</groupId>
<artifactId>artifact-id</artifactId>
<version>version</version>
</>