In the project, maven management is used, but several jars are not imported through maven, but imported through IDEA. When compiling with the maven plugin, the following errors will occur:
Solution:
Create a directory lib in the project, then copy the jar to this folder, and finally configure it in the maven compilation plugin as follows
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> <!-- Newly added here --> <compilerArguments> <!-- The location where the corresponding jar is placed in the project--> <extdirs>lib</extdirs> </compilerArguments> </configuration> </plugin>