前言
由于项目使用了matlab打包的jar包,且springboot项目需要引用该jar包
正文
1 项目建立lib文件夹,并将他作为根资源文件夹,将jar包复制过来
2 打开项目结构的,添加lib文件夹的jar包到项目路径
3 pom.xml加入以下代码即可
<dependency>
<groupId>GA_VRPT</groupId>
<artifactId>com.ldu.GA_VRPT</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/GA_VRP.jar</systemPath>
</dependency>
<dependency>
<groupId>javabuilder</groupId>
<artifactId>com.ldu.javabuilder</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/javabuilder.jar</systemPath>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</resources>
</build>