第一步,首先在项目根目录下建立lib文件夹,将本地jar包丢进去;
第二步,<dependencies>里面引入本地jar;
<dependency>
<groupId>爱怎么写怎么写</groupId>
<artifactId>爱怎么写怎么写</artifactId>
<version>爱怎么写怎么写</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/xxxx(本地jar名称).jar</systemPath>
</dependency>
第三步,在打成war包的时候复制到/WEB-INF/lib/里面;
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<webResources>
<resource>
<directory>${project.basedir}/lib</directory>
<targetPath>WEB-INF/lib</targetPath>
<filtering>false</filtering>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>