直接上图
这里提示找不到FSDirectory,然而在porn.xml中已经引入了该依赖。
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>${lucene.version}</version>
</dependency>
在项目中直接运行测试程序一切正常。因此猜测可能是打包的tomcat打包的时候没有导入这些jar包。
在网上找到了类似的问题:
https://blog.csdn.net/wf632856695/article/details/53425422