- maven打包时未添加lib中自定义jar包
解决方式
方法一:Maven提供了scope为system的依赖,我们可以在maven中进行如下配置
- 1.配置资源引用
<dependency>
<groupId>com.landray.sso.client</groupId>
<artifactId>EKP-SSO-client-java</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/EKP-SSO-client-java.jar</systemPath>
</dependency>
- 2.在spring-boot-maven-plugin插件中配置true(即包含scope中system的依赖)
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<mainClass>com.bfzy.mdm.DamApplication</mainClass>
<includeSystemScope>true</includeSystemScope><!--主要是这个配置-->
</configuration>
</execution>
</executions>
</plugin>
- jar包运行时unable to create schema complier
jar包部署后,webservice接口运行时,远程调用失败
异常:java.lang.ClassNotFoundException: com/sun/tools/internal/xjc/api/XJC
解决办法1:本地jdk或jre中lib中未存在tools.jar文件(jre默认安装未包含tools.jar)
解决办法2:jar包中lib下存在tools.jar,与本地tools.jar冲突。