基于Maven的SpringBoot项目添加第三方依赖
最近在做一个查询顺丰物流的接口,需要用到丰桥官网提供的一些jar,这些jar在maven仓库没有。所以需要下载下来再进行配置。
第一步:再resource目录下新键一个lib文件夹,存放下载好的jar。
第二补,在pom.xml中对这些jar进行坐标依赖。
<!--丰桥api依赖--> <dependency> <groupId>slf4j</groupId><!--可随意--> <artifactId>slf4j</artifactId><!--可随意--> <version>1.0</version><!--对应jar相应版本(不知道可随意)--> <scope>system</scope> <systemPath>${pom.basedir}/src/main/resources/lib/slf4j-api-1.7.7.jar</systemPath> </dependency> <dependency> <groupId>commons-codec</groupId><!--可随意--> <artifactId>commons-codec</artifactId><!--可随意--> <version>1.0</version><!--对应jar相应版本(不知道可随意)--> <scope>system</scope> <systemPath>${pom.basedir}/src/main/resources/lib/commons-codec-1.9.jar</systemPath> </dependency> <dependency> <groupId>commons-logging</groupId><!--可随意--> <artifactId>commons-logging</artifactId><!--可随意--> <version>1.0</version><!--对应jar相应版本(不知道可随意)--> <scope>system</scope> <systemPath>${pom.basedir}/src/main/resources/lib/commons-logging-1.2.jar</systemPath> </dependency> <dependency> <groupId>httpclient</groupId><!--可随意--> <artifactId>httpclient</artifactId><!--可随意--> <version>1.0</version><!--对应jar相应版本(不知道可随意)--> <scope>system</scope> <systemPath>${pom.basedir}/src/main/resources/lib/httpclient-4.3.4.jar</systemPath> </dependency> <dependency> <groupId>httpcore</groupId><!--可随意--> <artifactId>httpcore</artifactId><!--可随意--> <version>1.0</version><!--对应jar相应版本(不知道可随意)--> <scope>system</scope> <systemPath>${pom.basedir}/src/main/resources/lib/httpcore-4.3.2.jar</systemPath> </dependency> <dependency> <groupId>SF-CSIM-EXPRESS</groupId><!--可随意--> <artifactId>SF-CSIM-EXPRESS</artifactId><!--可随意--> <version>1.0</version><!--对应jar相应版本(不知道可随意)--> <scope>system</scope> <systemPath>${pom.basedir}/src/main/resources/lib/SF-CSIM-EXPRESS-SDK-V1.6.jar</systemPath> </dependency> <!--丰桥结束-->
完毕