0

我在 ivy.xml 中有以下定义

<dependency org="southbeach" name="ego" rev="4.3.1" conf="properties->asterik" >
  <artifact name="ego" type="conf" ext="conf" conf="properties->asterik"/>
</dependency>

我在ivysettings.xml中有运行时需要的扩展名conf或属性的文件,我有以下内容:

<filesystem name="privateFSa">
  <artifact pattern="${localRepositoryLocation}/[artifact].[ext]" />
</filesystem>

它总是试图寻找 ego.jar 而不是 ego.conf。可以请有人对此有所了解吗?我做错了什么还是常春藤只支持 tar、zip、gz、jar 而不是属性或 conf 文件?

我现在在 ivysettings.xml 中做了解决方法

<filesystem name="privateFSa">
      <artifact pattern="${localRepositoryLocation}/[artifact].conf" />
</filesystem>

但这看起来对那里的 conf 进行硬编码并不好。谢谢,
阿尔马斯

4

1 回答 1

0

如果没有更详细的示例,我不确定出了什么问题。

这是我的工作项目

$ find . -type f
./build.xml
./ivy.xml
./ivysettings.xml
./repository/southbeach/ego/4.3.1/confs/ego.conf

ivy 文件声明了项目依赖项:

$ cat ./ivy.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="2.0">
    <info organisation="com.myspotontheweb" module="demo"/>
    <dependencies>
        <dependency org="southbeach" name="ego" rev="4.3.1">
            <artifact name="ego" type="conf"/>
        </dependency>
    </dependencies>
</ivy-module>

和常春藤设置文件

$ cat ./ivysettings.xml
<ivysettings>
    <settings defaultResolver="privateFSa"/>
    <resolvers>
        <filesystem name="privateFSa">
            <artifact pattern="${ivy.settings.dir}/repository/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]" />
        </filesystem>
    </resolvers>
</ivysettings>

下载就好了

$ ant
Buildfile: build.xml
..
..
[ivy:retrieve]  found southbeach#ego;4.3.1 in privateFSa
[ivy:retrieve] downloading /????/repository/southbeach/ego/4.3.1/confs/ego.conf ...
[ivy:retrieve] .. (0kB)
..
..

您是否可能需要清理常春藤缓存目录?(参见ivy:cleancache任务)

我在想,在您添加“工件”条目之前,常春藤可能会采用较旧的模块分辨率。

于 2010-05-23T15:24:34.927 回答