1.jar包打包方式打入第三方jar包,pom文件配置
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.maven.plugin.version}</version>
<configuration>
<!--解决本地jar包打不进jar的问题-->
<includeSystemScope>true</includeSystemScope>
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
2.war包打包方式打入第三方jar包,pom文件配置
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<!--war包第三方-->
<webResources>
<resource>
<directory>${project.basedir}/../lib</directory>
<targetPath>WEB-INF/lib/</targetPath>
<includes>
<include>*.jar</include>
</includes>
</resource>
</webResources>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${artifactId}</warName>
</configuration>
</plugin>
jar包引入
<!--oracle驱动-->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/ojdbc14-10.2.0.2.0.jar</systemPath>
</dependency>