Maven外部依赖
我們使用Maven從中央庫或者從本地庫等獲取所需要的jar文件,但有的項目文件即不在中央庫又不在本地庫,需要我們手動下載。
外部依賴注入的兩種方式:
1. 通過install-file 的形式加入到本地庫。?mvn install:install-file -Dfile=c:\kaptcha-{version}.jar -DgroupId=com.google.code
-DartifactId=kaptcha -Dversion={version} -Dpackaging=jar但這種方式,移植到其它地方后,又需要再次加入到另一電腦的本地庫。
ojdbc因為牽扯付費因此雖然在mvn上可以看到但是沒法下載。
mvn install:install-file -Dfile=D:\Repository\ojdbc14-10.2.0.4.0.jar -DartifactId=ojdbc14 -DgroupId=com.oracle -Dversion=10.2.0.4.0 -Dpackaging=jar
2. 項目中外部依賴
在src目錄下創建lib文件夾,將jar文件放入其中。
在pom.xml文件中添加以下數據:
<dependency>
<groupId>ojdbc</groupId>
<artifactId>ojdbc</artifactId>
<scope>system</scope>
<version>6</version>
<systemPath>${basedir}\src\lib\ojdbc-6.jar</systemPath>
</dependency>
保存后,數據會自動進入到Maven Dependency中。
?
?
?
轉載于:https://www.cnblogs.com/DennyZhao/p/7699528.html
總結
- 上一篇: selinux学习
- 下一篇: LiveVideoStackCon 20