参考

https://segmentfault.com/a/1190000022058327

步骤

  1. 项目新建一个 lib 文件夹,将 jar 包放到 lib 下面

    image-20201224101503108
  2. pom 中添加依赖

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    <!-- https://mvnrepository.com/artifact/net.sf.ucanaccess/ucanaccess -->
    <dependency>
    <groupId>net.sf.ucanaccess</groupId>
    <artifactId>ucanaccess</artifactId>
    <version>4.0.0</version>
    <scope>system</scope>
    <systemPath>${basedir}/lib/ucanaccess-4.0.0.jar</systemPath>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.healthmarketscience.jackcess/jackcess -->
    <dependency>
    <groupId>com.healthmarketscience.jackcess</groupId>
    <artifactId>jackcess</artifactId>
    <version>2.1.11</version>
    <scope>system</scope>
    <systemPath>${basedir}/lib/jackcess-2.1.11.jar</systemPath>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.hsqldb/hsqldb -->
    <dependency>
    <groupId>org.hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <version>2.5.1</version>
    <scope>system</scope>
    <systemPath>${basedir}/lib/hsqldb-2.5.1.jar</systemPath>
    </dependency>
  3. springboot 的打包插件引入一下参数

    1
    2
    3
    4
    5
    6
    7
    8
    <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <!-- configuration 标签内容为引入代码-->
    <configuration>
    <includeSystemScope>true</includeSystemScope>
    </configuration>
    </plugin>