日常開發中大家普遍使用了maven 管理引用的jar ,或者使用公共倉庫,或者使用公司自己搭建的私有倉庫
如果遇到項目需要引用第三方jar ,可以採用以下兩種方式處理:
1.本地引用
<dependency>
<groupId>com.aspose.words</groupId>
<artifactId>aspose-words</artifactId>
<version>15.8.0</version>
<classifier>jdk16</classifier>
<scope>system</scope>
<systemPath>${project.basedir}/file/aspose-words-15.8.0-jdk16.jar</systemPath>
</dependency>
方便快捷,適合單節點項目
2.將第三方jar 上傳到公司私有maven 倉庫
2.1maven私有倉庫管理界面:
私服倉庫有對應的賬戶密碼
2.2管理後臺上傳第三方jar
2.3 引用
2.4 pom中配置信息:
倉庫配置
<repositories>
<repository>
<id>maven-public</id>
<url>http://192.168.11.111:1111/repository/maven-public/</url>
<layout>default</layout>
</repository>
<repository>
<id>maven-releases</id>
<url>http://192.168.11.111:1111/repository/maven-releases/</url>
<layout>default</layout>
</repository>
</repositories>
參考資料:
https://www.cnblogs.com/chywx/p/11227151.html