【问题标题】:How to give url of folder to ivy pattern如何将文件夹的网址提供给常春藤模式
【发布时间】:2014-10-20 16:50:44
【问题描述】:

在 ivyconf.xml 中,我有 pattern='${ivy.settings.dir}/../../lib/Google Guava/[artifact].[ext]' />。如您所见,我在模式中写了Google Guava。但是,我在 Google Guava 文件夹的同一级别的另一个文件夹中存储了多个 jar 文件。

我尝试用** 代替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

【问题讨论】:

标签: java ant ivy


【解决方案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>

如您所见,我没有使用organisation="FS" 在自己的文件系统中解析它们。然后,我使用organisation 变量作为存储文件夹名称的容器。

最后,我得到的是干净的项目层次结构。

【讨论】:

    猜你喜欢
    • 2016-05-28
    • 2015-08-27
    • 2011-04-05
    • 2012-12-23
    • 2016-02-15
    • 2014-08-13
    • 2011-04-12
    • 2013-07-13
    • 1970-01-01
    相关资源
    最近更新 更多