pom.xml文件中增加:
<dependency>
<groupId>com.hankcs</groupId>
<artifactId>hanlp</artifactId>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/hanlp-1.5.2.jar</systemPath>
</dependency>
字典和模型文件在项目中的位置,其中包括自定义词典:

data文件夹在项目中的位置:

hanlp.properties文件的位置:

这样就可以在web项目中应用。