idea導(dǎo)入jar包的詳細(xì)圖文教程
通過添加Libraries的方式引入:
1、首先在根目錄下創(chuàng)建一個 libs 的目錄
2、打開 File -> Project Structure
3、單擊 Libraries -> "+" -> "Java" -> 選擇我們導(dǎo)入的項目主目錄,點擊OK
4、注意:在彈出的方框中點擊“Cancel”,取消將其添加到Module中。
5、libs目錄創(chuàng)建成功,刪除目錄中添加進(jìn)來的多余內(nèi)容,重新添加需要的jar包
6、重新添加需要的jar包
7、引入jar包:Modules -> 項目 -> “Dependencies”,點擊“+” -> “Library”,將剛才創(chuàng)建成功的Library目錄加入
8、jar包導(dǎo)入成功!
9、如果要將引入的jar包打包到war中,需要在pom文件中添加以下配置+
<!-- 引用本地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>
<!-- 將本地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>
總結(jié)
到此這篇關(guān)于idea導(dǎo)入jar包的文章就介紹到這了,更多相關(guān)idea導(dǎo)入jar包內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
JAVA實現(xiàn) springMVC方式的微信接入、實現(xiàn)消息自動回復(fù)實例
本篇文章主要介紹了JAVA實現(xiàn) springMVC方式的微信接入、實現(xiàn)消息自動回復(fù),這里整理了詳細(xì)的代碼,有需要的小伙伴可以參考下。2016-12-12Spring Boot從Controller層進(jìn)行單元測試的實現(xiàn)
這篇文章主要介紹了Spring Boot從Controller層進(jìn)行單元測試的實現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-04-04Spring Boot 與 Kotlin 上傳文件的示例代碼
這篇文章主要介紹了Spring Boot 與 Kotlin 上傳文件的示例代碼,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-01-01Java反射之Call stack introspection詳解
這篇文章主要介紹了Java反射之Call stack introspection詳解,具有一定參考價值,需要的朋友可以了解下。2017-11-11System.currentTimeMillis()計算方式與時間的單位轉(zhuǎn)換詳解
這篇文章主要介紹了System.currentTimeMillis()計算方式與時間的單位轉(zhuǎn)換詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-05-05mybatis連接MySQL8出現(xiàn)的問題解決方法
這篇文章主要介紹了mybatis連接MySQL8出現(xiàn)的問題解決方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-10-10