Springboot 打包本地 jar 丢失处理

发布时间 2023-10-09 17:25:36作者: 山河已无恙

pom 中引用一下

        <dependency>
            <groupId>com.sun.jna</groupId>
            <artifactId>jna</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/sdk/lib/jna.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>com.sun.jna.examples</groupId>
            <artifactId>examples</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/sdk/lib/examples.jar</systemPath>
        </dependency>

打包选项

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