1.使用maven 安装的jar,需要在POM中这样配置
<dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.4.0</version> <scope>system</scope> <systemPath>${basedir}/lib/ojdbc14-10.2.0.4.0.jar</systemPath> </dependency>
2.使用add as library 需要在POM中这样配置
<build> <finalName>sms</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> <resource> <directory>${basedir}/src/main/resources</directory> </resource> <!--外部jar包地址--> <resource> <directory>${basedir}/lib</directory> <targetPath>BOOT-INF/lib/</targetPath> <includes> <include>**/*.jar</include> </includes> </resource> </resources> </build> <!-- 第二种 --> <build> <finalName>sms</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.xml</include> <include>**/*.yml</include> </includes> <filtering>true</filtering> </resource> <!--外部jar包地址--> <resource> <directory>${basedir}/lib</directory> <targetPath>BOOT-INF/lib/</targetPath> <includes> <include>**/*.jar</include> </includes> </resource> </resources> </build>