手动引入jar包

      <dependency>
            <groupId>com.allinpay.sdk</groupId>
            <artifactId>top-sdk-java</artifactId>
            <version>1.0.5</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/lib/top-sdk-java-1.0.5.jar</systemPath>
        </dependency>

因入后本地正常运行

打包服务器上报错

返现虽然手动引入,服务器上运行类未找到

解决方法,给spring-boot的打包插件设置一下includeSystemScope参数即可

 <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
              //加入这个includeSystemScope
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
            </plugin>
        </plugins>
    </build>

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐