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 裏面添加模塊,我這邊沒有進行設置也能正常打包並運行.