假设将包htmlparser.jar放入了项目下的lib目录中 -> ${project}/lib/htmlparser.jar
则pom.xml中应该配置如下:
<dependency> <groupId>com.htmlparser</groupId> <artifactId>htmlparser</artifactId> <version>2.0</version> <scope>system</scope> <systemPath>${project.basedir}/lib/htmlparser.jar</systemPath> </dependency>
或者 install一个
mvn install:install-file -Dfile=<path-to-file> -DpomFile=<path-to-pomfile>
参考文章:
https://www.oschina.net/question/163296_23801
http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html