最近想引入自己的jar包  在resources下建了一个目录  本地运行没有问题  打包打不进去:

pom.xml

	<dependency>
            <groupId>com.dm</groupId>
            <artifactId>xxx</artifactId>
            <version>1.xx</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/lib/xxx.jar</systemPath>
        </dependency>

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

 

 

<!--指定引入外部包的位置 mvn package -Dmaven.test.skip=true-->
<!--打包部署放开以下注释-->
<!--正常启动需注释以下代码,否则会包shiro错误-->
<resources>
<resource>
<directory>${project.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>

  

 参考链接2:

https://blog.csdn.net/weixin_42476367/article/details/123085691