通过添加Libraries的方式引入:
1、首先在根目录下创建一个 libs 的目录
![](https://img-blog.csdnimg.cn/img_convert/9c184fedcaf036dc9318e30edde96017.png)
2、打开 File -> Project Structure
3、单击 Libraries -> "+" -> "Java" -> 选择我们导入的项目主目录,点击OK
![](https://img-blog.csdnimg.cn/img_convert/c035ac41b5d8cde99f44407d60d70b34.png)
![](https://img-blog.csdnimg.cn/img_convert/f298c6b4bface4f5fbcacdf973237f8d.png)
4、注意:在弹出的方框中点击“Cancel”,取消将其添加到Module中。
5、libs目录创建成功,删除目录中添加进来的多余内容,重新添加需要的jar包
![](https://img-blog.csdnimg.cn/img_convert/da51d0fc27b9c1f79ffa9824f8d90e54.png)
6、重新添加需要的jar包
![](https://img-blog.csdnimg.cn/img_convert/c9fef1ea89a6586c50bb23ba415facd3.png)
![](https://img-blog.csdnimg.cn/img_convert/fec5c980567259c34bc5d157d9f44b44.png)
![](https://img-blog.csdnimg.cn/img_convert/56d1f13653962af302d4d89305c52035.png)
7、引入jar包:Modules -> 项目 -> “Dependencies”,点击“+” -> “Library”,将刚才创建成功的Library目录加入
![](https://img-blog.csdnimg.cn/img_convert/65fec5705c0349f41f6ecd953ac40740.png)
![](https://img-blog.csdnimg.cn/img_convert/38b284e2a4249c1cf536e37aa0e4ba18.png)
8、jar包导入成功!
9、如果要将引入的jar包打包到war中,需要在pom文件中添加以下配置+
![](https://img-blog.csdnimg.cn/img_convert/f183aa7f66a91701a8968cfef98ac3a4.gif)
<!-- 引用本地jar包 -->
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>16.8.0</version>
<scope>system</scope>
<systemPath>${pom.basedir}/libs/aspose-words-16.8.0-jdk16.jar</systemPath>
</dependency>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-cells</artifactId>
<version>8.5.2</version>
<scope>system</scope>
<systemPath>${pom.basedir}/libs/aspose-cells-8.5.2.jar</systemPath>
</dependency>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-slides</artifactId>
<version>15.9.0</version>
<scope>system</scope>
<systemPath>${pom.basedir}/libs/aspose.slides-15.9.0.jar</systemPath>
</dependency>
![](https://img-blog.csdnimg.cn/img_convert/f183aa7f66a91701a8968cfef98ac3a4.gif)
![](https://img-blog.csdnimg.cn/img_convert/9ebef272043a3af8b503915f6acccfeb.gif)
<!-- 将本地jar包打到war中 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>compile</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/lib</outputDirectory>
<includeScope>system</includeScope>
</configuration>
</execution>
</executions>
</plugin>