2011-05-16 241 views
0

我正在爲我的項目使用maven。我有5個地方的jar文件作爲我的pom.xml指定如下相關文件:Maven跳過依賴文件?

<dependency> 
    <groupId>EWSAPI</groupId> 
    <artifactId>EWSAPI</artifactId> 
    <version>1.1</version> 
    <scope>system</scope> 
    <systemPath>${basedir}/EWSAPI1.1.jar</systemPath> 
    </dependency> 


    <dependency> 
    <groupId>jcifs</groupId> 
    <artifactId>jcifs</artifactId> 
    <version>1.3.15</version> 
    <scope>system</scope> 
    <systemPath>${basedir}/jcifs-1.3.15.jar</systemPath> 
    </dependency> 



    <dependency> 
    <groupId>commons-codec</groupId> 
    <artifactId>commons-codec</artifactId> 
    <version>1.4</version> 
    <scope>system</scope> 
    <systemPath>${basedir}/commons-codec-1.4.jar</systemPath> 
    </dependency> 


    <dependency> 
    <groupId>commons-httpclient</groupId> 
    <artifactId>commons-httpclient</artifactId> 
    <version>3.1</version> 
    <scope>system</scope> 
    <systemPath>${basedir}/commons-httpclient-3.1.jar</systemPath> 
    </dependency> 


    <dependency> 
    <groupId>commons-logging</groupId> 
    <artifactId>commons-logging</artifactId> 
    <version>1.1.1</version> 
    <scope>system</scope> 
    <systemPath>${basedir}/commons-logging-1.1.1.jar</systemPath> 
    </dependency> 

現在,當我嘗試安裝MVN在命令提示符下安裝的依賴關係。我得到以下信息

The following files where skipped: 
    EWSAPI:EWSAPI:java-source:sources:1.1 
    commons-codec:commons-codec:java-source:sources:1.4 
    commons-httpclient:commons-httpclient:java-source:sources:3.1 
    commons-logging:commons-logging:java-source:sources:1.1.1  

而且一個文件jfis被跳過

我不明白(這是上面提到的依賴一樣)爲什麼Maven是這樣做?我感謝你的幫助。由於

回答

1

嘗試這樣:

<repositories> 
    <repository> 
     <id>my-internal-site</id> 
     <url>file:///${basedir}</url> 
    </repository> 
</repositories> 

然後刪除系統路徑參數。

另外,你確定範圍應該是系統?

1

從這個問題,目前還不清楚你想要做什麼。

一方面你提到I have 5 local jar files as dependent files,你指定<system>範圍在pom.xml。另一方面你提到運行mvn installto install the dependencies

除非有令人信服的理由,尤其對於第三方依賴關係(如commons-codec),否則您應該避免使用<system>作用域。

mvn install構建指定的項目並將其安裝在本地存儲庫中。它不是安裝dependencies

在分別下載它們之後,您可以使用mvn install:install-file <params>install依賴關係到本地存儲庫。他們沒有在${basedir}中獲得installed

如果以上方法無效,請更新您的問題。