- 在根目录下创建一个lib文件夹,放入jar包。
- 点击jar包右键
add as library
加到项目中。 - pom.xml文件中新增jar包对应的
<dependency>
<dependency>
<groupId>test.groupId</groupId>
<artifactId>test-artifactId</artifactId>
<version>0.0.1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/test.jar</systemPath>
</dependency>
- 在
spring-boot-maven-plugin
中加入以下配置:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>