在项目中增加lib文件,将第三方的jar导入其中,然后pom.xml加上 ,此时项目就可以运行了,但是如果要打包项目成jar,还需要下一步骤!
<dependency> <groupId>com.okcoin.commons</groupId> <artifactId>okex-java-sdk-api</artifactId> <version>v0.1</version> <scope>system</scope> <systemPath>${project.basedir}/lib/okex-java-sdk-api.jar</systemPath> </dependency>
打包插件这里要加上configuration 这一步骤,然后运行maven的clean和package命令打包后就会把你外部引入的jar包打包到你的项目中了。
<!--将第三方jar打包到项目--> <configuration> <includeSystemScope>true</includeSystemScope> </configuration>
https://blog.csdn.net/weixin_42047118/article/details/87484288