首先看下报错
主要还是java.lang.NoClassDefFoundError: Could not initialize class
定位问题:
这里面编译之后,压根找不到lib目录,所以找不到这个类很正常
解决方案:
<dependency>
<groupId>net.xdstar</groupId>
<artifactId>personinfo</artifactId>
<scope>system</scope>
<version>0.0.1</version>
<systemPath>${project.basedir}/src/main/resources/lib/xdpersoninfo.jar</systemPath>
</dependency>
把jar包引入一下,groudId一直到version都可以自定义,开心就好,系统路径要好好写,得是真实的
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<compilerArguments>
<extdirs>lib</extdirs>
</compilerArguments>
</configuration>
</plugin>
</plugins>
</build>
build里面加一个路径然后在springboot-maven底下加一个true
最后完美解决本次任务