<dependency>
        <groupId>自定义</groupId>
        <artifactId>自定义</artifactId>
        <version>自定义</version>
        <scope>system</scope>
        <systemPath>${pom.basedir}/lib/okhttp3-1.0.jar</systemPath>
    </dependency>

设置scope(作用域)为system(系统)再配置systemPath(系统路径),其中${pom.basedir}也可以换成${project.basedir},pom就是pom所在路径,project就是project路径

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

加入configuration配置includeSystemScope为true

        <resource>
            <directory>lib</directory>
            <targetPath>/BOOT-INF/lib/</targetPath>
            <includes>
                <include>**/*.jar</include>
            </includes>
        </resource>

加入resource,将lib目录下所有jar包打进包中的/BOOT-INF/lib/路径