maven pom 配置 compile的web项目时指定/WEB-INF/lib 目录或者其他非maven仓库的jar作为额外的库目录,需要进行配置。
<plugin>
<artifactId>maven-compiler-pluginartifactId>
<configuration>
<source>1.7source>
<target>1.7target>
<encoding>UTF-8encoding>
<compilerArguments>
<extdirs>src\main\webapp\WEB-INF\libextdirs>
compilerArguments>
configuration>
plugin>
<dependency>
<groupId>com.go6dgroupId>
<artifactId>animateartifactId>
<version>1.0.0version>
<scope>systemscope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/animate.jarsystemPath>
dependency>
1、把本地的jar报install到本地库
mvn install:install-file -Dfile=lucene-queryparser-4.6.1.jar -DgroupId=org.apache.lucene -DartifactId=lucene-queryparser -Dversion=4.6.1 -Dpackaging=jar
2、然后配置maven配置pom.xml文件
<dependency>
<groupId>org.apache.lucenegroupId>
<artifactId>lucene-queryparserartifactId>
<version>4.6.1version>
dependency>
3、maven update项目,验证依赖是否添加到项目中