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包的,未測試。