2014-08-27 68 views
0

在ivyconf.xml中,我有pattern='${ivy.settings.dir}/../../lib/Google Guava/[artifact].[ext]' />。正如你所看到的,我寫了Google Guava的模式。但是,我有一個以上的jar文件存儲在Google Guava文件夾的同一級別的另一個文件夾中。如何給ivy模式的文件夾的URL

我試過**來代替Google Guava,但我認爲它在ivyconf.xml中不被支持。我應該寫什麼而不是Google Guava,以便它搜索所有文件夾以解決依賴關係?

ivyconf.xml

<resolvers> 
     <filesystem name="local"> 
      <artifact 
        pattern='${ivy.settings.dir}/../../lib/Google Guava/[artifact].[ext]' /> 
     </filesystem> 
    </resolvers> 
    <modules> 
     <module organisation='FS' resolver='local' /> 
    </modules> 

項目結構

project 
    | - - - src 
      ... 
    | - - - lib 
      | - - Google Guava 
        | - - guava.jar 
      | - - Folee 
        | - - folee-1.4.0.jar 
+0

可能重複的[如何修復在番石榴錯誤中找不到的配置](http://stackoverflow.com/questions/25505746/how-to-fix-configuration-not-found-in-guava-error) – 2014-08-27 13:51:05

回答

1

我已經找到了如何解決它。

首先,我改變了ivy.xml的樣子;

<dependencies> 
    <dependency org="Google Guava" name="guava" rev="17.0" 
       conf="compile->default"/>  
    <dependency org="Folee" name="folee-1.4.0" rev="1.4.0" 
       conf="compile->default"/>  
</dependencies> 

然後,我改變了ivyconf.xml的樣子;

<conf defaultresolver="local"/> 
<resolvers> 
     <filesystem name="local"> 
      <artifact 
       pattern="${ivy.settings.dir}/../../lib/[organisation]/[artifact].[ext]" /> 
     </filesystem> 
</resolvers> 
<modules> 
    <module resolver="local" /> 
</modules> 

正如你看到的,我havenot使用organisation="FS"來解決他們自己的文件系統。然後,我用organisation變量作爲容器來存儲文件夾名稱。

最後,我得到的是乾淨的項目層次結構。

相關問題