springboot将外部引入的jar包打进war包中
以oracle为例:
第一步:引入jar包,${basedir}是系统参数
<!-- oracle驱动包 -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>12.1.0.1-atlassian-hosted</version>
<scope>system</scope>
<systemPath>${basedir}/lib/ojdbc6-12.1.0.1-atlassian-hosted.jar</systemPath>
</dependency>
第二步:在
<!--设置maven-war-plugins插件,否则外部依赖无法打进war包-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>lib</directory>
<targetPath>WEB-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
第三步:执行打包命令mvn clean package
转载于//www.cnblogs.com/zhengOK/p/11121526.html
还没有评论,来说两句吧...