Tag Archives: Springboot introduces local jar package error

Springboot introduces local jar package to deploy to server error [How to Solve]

1. Introduce the local jar package method in pom.xml

<dependency> 
    <groupId>com.arcsoft.face</groupId> 
    <artifactId>arcsoft-sdk-face</artifactId> 
    <version>3.0.0.0</version> 
    <scope>system</scope> 
    <systemPath>${ project.basedir}/src/main/resources/lib/linux-arcsoft-sdk-face-3.0.0.0.jar</systemPath> 
</dependency>

Description: systemPath specifies the path to the jar package

2. The important thing to add to the following configuration is the red configuration

<plugins> 
   <plugin> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-maven-plugin</artifactId> 
      <configuration> 
         <includeSystemScope>true</includeSystemScope>
       </configuration> 
   </plugin > 
</plugins> 

Note: includeSystemScope means that when maven is packaged, it will package the imported jar package (such as adding an external jar package in the root directory or under the resource file) into the project jar, and the project can be run on the server. Do not add this Configuration, it can run locally, because the external package can be found under lib locally, but there is no jar on the server.