maven添加本地jar包

  1. pom.xml添加一个自定义的本地仓库
1
2
3
4
5
6
7
8
9
10
11
...
<repositories>
...
<repository>
<id>ProjectRepo</id>
<name>ProjectRepo</name>
<url>file://${project.basedir}/src/main/webapp/lib</url>
</repository>
...
</repositories>
...
  1. 修改jar包路径到本地仓库目录
    ${repo-dir}/groupid/artifactid/version/artifactid-version.jar

  2. pom.xml中添加依赖

1
2
3
4
5
<dependency>
<groupId>yourgroupid</groupId>
<artifactId>your-artifactid</artifactId>
<version>versioncode</version>
</dependency>