1.添中第三方包
在程序 pom.xml 加入第三方包,指定包含路径
<dependencies>
<!--PLC通讯-->
<dependency>
<groupId>jamod</groupId>
<artifactId>jamod</artifactId>
<version>1.2</version>
<scope>system</scope>
<systemPath>${basedir}/src/lib/jamod-1.2-SNAPSHOT.jar</systemPath>
</dependency>
</dependencies>
scope设成 system, 添加 systemPath 设置第三方包的路径
2.修改maven插件配置
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
<finalName>Timo-${project.version}</finalName>
</build>
记得在maven插件下面加入 configuration 设置,表示打包时需查找system目录程序进行打包.
3.备注
到于在 Project Structure 里面添加模块,我这边没有进行设置也能正常打包并运行.