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>
maven scope system 在springboot项目中引入本地jar包
最新推荐文章于 2023-09-23 11:54:05 发布