springboot 引入第三方jar 防在resource路徑下 釋出伺服器提示 class not found

zhang8907xiaoyue發表於2020-12-09

1、新增引用

<dependency>
            <groupId>com.openapi</groupId>
            <artifactId>sdk</artifactId>
            <version>6.0</version>
            <scope>system</scope>
            <systemPath>${basedir}/src/main/resources/lib/openapi-sdk-6.0.jar</systemPath>
        </dependency>

2、新增發布補充說明

<build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources/lib</directory>
                <targetPath>BOOT-INF/lib/</targetPath>
                <includes>
                    <include>**/*.jar</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <targetPath>BOOT-INF/classes/</targetPath>
            </resource>
        </resources>
    </build>

 

相關文章