pom.xml中引入项目中的jar包(通过<scope>system</scope>依赖本地jar包)

 

 

<dependency>
            <groupId>com.hbis.infmgr</groupId>
            <artifactId>sign-utils</artifactId>
            <version>0.0.1</version>
            <!--此处忽略sonar警告,因报表组件是定制化的本地包,放到了项目目录内,所以需要通过system-scope引入-->
            <scope>system</scope>
            <systemPath>${project.basedir}/lib/infmgr-common-0.0.1.jar</systemPath>
        </dependency>

 如果你仅仅是这么做了,在你使用SpringBoot打包插件生成jar包的时候,你会发现这个jar包不会被打进去,进而出现错误。
这个就需要在maven插接中配置一个includeSystemScope属性:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <!--设置为true,以便把本地的system的jar也包括进来-->
        <includeSystemScope>true</includeSystemScope>
    </configuration>
</plugin>

 

posted @   Ning-  阅读(337)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示