有时候项目上没有maven仓库,又提供了一个jar包,会使用临时本地引入jar包的形式,例如

<dependency>
    <groupId>com.erbao</groupId>
    <artifactId>file</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/resources/lib/file.1.0.jar
    </systemPath>
</dependency>

springboot默认打包方式是不会奖本地引入的包打入到jar包中,需要在maven的plugin配置中添加配置<includeSystemScope>true</includeSystemScope>

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

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐