本地jar包添加到maven依赖中

对于本地jar包,如果要添加到maven依赖中,可以使用如下方式:

1
2
3
4
5
6
7
<dependency>
<groupId>groupId</groupId>
<artifactId>artifactId</artifactId>
<version>version</version>
<scope>system</scope>
<systemPath>本地jar包路径</systemPath>
</dependency>

指定scope为system,maven会直接使用systemPath指定路径下的jar包。