Maven项目添加本地jar包依赖

2020-04-16  本文已影响0人  Mrchen_747c

添加依赖
把本地依赖的jar包放在resources下的lib目录中。

<dependency>
    <groupId>com.test</groupId>
    <artifactId>test-utils</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/resources/lib/test-utils-1.0.0.jar</systemPath>
</dependency>

修改配置
Spring Boot插件添加<includeSystemScope>true</includeSystemScope>配置。

<plugins>
    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
            <includeSystemScope>true</includeSystemScope>
        </configuration>
    </plugin>
</plugins>
上一篇 下一篇

猜你喜欢

热点阅读