SpringBoot引入本地sdk/jar包

140 阅读1分钟
  • 在项目的根目录下创建lib文件夹,在该文件夹中放入sdk/本地jar包

  • pom.xml中引入这个依赖

    <dependency>
        <groupId>com.nbopen</groupId>
        <artifactId>openBasicSDK</artifactId>
        <version>1.6.7</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/lib/openBasicSDK-1.8.1.jar</systemPath>
    </dependency>
    
  • pom.xml中配置本地jar包也要 打包到最终产物中

    <build>
        <finalName>yh-api-service</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
        </plugins>
    </build>