在pom.xml文件中添加:
<dependency>
<groupId>com.baich</groupId>
<artifactId>demo</artifactId>
<systemPath>${project.basedir}/src/main/resources/lib/demo-1.0-SNAPSHOT.jar</systemPath>
<!--必須指定scope-->
<scope>system</scope>
</dependency>
在项目类文件中即可正常引用:

如果要在项目打包时将此jar包打入依赖,pom.xml应加入以下配置:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--添加此项配置-->
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>

3745

被折叠的 条评论
为什么被折叠?



