springboot引入外部jar包

  1. 与src目录同级新建lib目录
    .
  2. 在pom中引用
<dependency>
    <groupId>com.xxx.yyy</groupId>
    <artifactId>xxx-jdk15</artifactId>
    <version>2.0.29</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/lib/xxx-jdk15.jar</systemPath>
</dependency>

3.最后别忘了最后的build标签

true

如果不加的话, 编译器运行没问题, 但是打包会缺失这个jar包

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

你可能感兴趣的:(springBoot,springboot,引入外部jar包)