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.
Similar Posts:
- springboot Cannot load driver class: oracle.jdbc.driver.OracleDriver
- Maven warnning: ‘build.plugins.plugin.version’ is missing [How to Solve]
- [Solved] SpringBoot Project Package to jar Error: ClassNotFound…
- Springboot always reports an error when importing JSP dependencies
- Maven no main manifest attribute when generate jar for project
- Unregistering JMX-exposed beans on shutdown Solution
- [Solved] SpringBoot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-res
- [Solved] Spring Boot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0
- Eureka server project startup error handling
- Run jar file under Linux system, prompt: no main manifest attribute, in xxx.jar [How to Solve]