Maven 打包时引用项目中lib目录下的jar文件
<dependency>
<groupId>xxxxxxxx</groupId>
<artifactid>xxxxxxx</artifactid>
<version>2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/xxxxxx-2.0.jar</systemPath>
</dependency>
在plugins中添加 plugin 如:
<plugin>
<groupid>org.springframework.boot</groupId>
<artifactid>spring-boot-maven-plugin</artifactid>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
Maven 打包时引用项目中lib目录下的war文件
<dependency>
<groupId>xxxxxxxx</groupId>
<artifactid>xxxxxxx</artifactid>
<version>2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/xxxxxx-2.0.jar</systemPath>
</dependency>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceExcludes>src/main/resource/**</warSourceExcludes>
<warName>XXXX</warName>
<webResources>
<resource>
<directory>${project.basedir}/src/main/resources/lib</directory>
<targetPath>WEB-INF/lib</targetPath>
<filtering>true</filtering>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>