1.将jar包引入
在resources中创建lib文件夹,将jar包复制进去,然后将jar包Add as Library...
2.在在maven中引入jar包
在pom文件中:
<dependency>
<groupId>com.test</groupId>
<artifactId>test1</artifactId> <!--引入多个jar包时groupId+artifactId不要重复-->
<scope>system</scope>
<version>1.0</version><!--版本号-->
<!--systemPath写jar包的路径,${project.basedir}是指当前项目的根目录-->
<systemPath>${project.basedir}/src/main/resources/lib/FLSB.jar</systemPath>
</dependency>
3.springboot项目打包配置
在pom文件中:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--这里写上main方法所在类的路径-->
<mainClass>com.matlab.qm.QmApplication</mainClass>
<!--值为true是指打包时包含scope为system的第三方Jar包-->
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
总结
个人备忘笔记。
这里https://blog.csdn.net/qq_27900925/article/details/100508256有打war包的,未测试。