一、引入本地庫
1、File -> Project Structure -> Libraries,點擊+,新增本地lib庫。
2、File -> Project Structure -> Modules -> Dependencies,新增Library,選擇第一步創建的lib庫。
二、將本地庫war打包
pom.xml文件中增加如下內容:
<build> <finalName>mdfind</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.3</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> <warName>${project.artifactId}</warName> <webResources> <resource> <directory>lib/</directory> <targetPath>WEB-INF/lib</targetPath> <includes> <include>**/*.jar</include> </includes> </resource> </webResources> </configuration> </plugin> </plugins> </build>