本文以导入支付宝alipay的sdk为例
<!-- 支付宝支付 -->
<dependency>
<groupId>com.alipay</groupId>
<artifactId>alipay-sdk</artifactId>
<version>20170829142630</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/alipay-sdk-java20170829142630.jar</systemPath>
</dependency>
<scope>system</scope>
是设置类型,${project.basedir}
是Maven内置变量,可取到项目根路径
Spring Boot项目在pom.xml
的build >plugins
中添加
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>