maven scope system 在springboot项目中引入本地jar包




system 
This scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.

此范围与提供的类似,只是您必须提供明确包含它的JAR。 工件始终可用,并且不会在存储库中查找。

springbootApplication所在项目或者application依赖的module中

    <dependency>
            <groupId>com.bsapi</groupId>
            <artifactId>shaded</artifactId>
            <version>3.6.1</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/jar/bsApi-3.6.1-shaded.jar</systemPath>
        </dependency>


src/main/resources/jar/bsApi-3.6.1-shaded.jar



springbootApplication所在module中的pom文件设置的

 <!--依赖本地jar包必须这么做-->
    <build>
        <plugins>

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

        </plugins>
    </build>





猜你喜欢

转载自blog.csdn.net/weixin_34348174/article/details/90995258
今日推荐