普通jar包导入方法
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
但是如果有些包公共仓库没有,需要自己引入,我下面的配置则是从本地目录下引入 ,${project.basedir}是项目的根目录
<dependency>
<groupId>com.cloudera.impala.jdbc</groupId>
<artifactId>ImpalaJDBC41</artifactId>
<version>2.6.10</version>
<scope>system</scope>
<systemPath>${project.basedir}/drivers/ImpalaJDBC41.jar</systemPath>
</dependency>
使用这个配置后本地使用IDEA启动项目没有问题,但是在打包时发现了引入的jar包没有打进去,因为他的作用域 是system
解决办法
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--解决system引用本地jar包打不进jar的问题-->
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
623

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



