build - Ivy 模块的多个工件

标签 build ivy

我想通过 ivy 将 jar 检索到特定文件夹(如 lib),下面是我在 build.xml 中的检索定义:

<ivy:retrieve pattern="lib/[artifact].[ext]" conf="webInfLib" />

我的 ivy.xml 的定义如下:
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
       xmlns:m="http://ant.apache.org/ivy/maven">
    <info organisation="xxxx" module="xxxx" status="integration"/>
    <configurations>
        <conf name="webInfLib"  description="add jar to web-inf/lib folder"/>
    </configurations>
    <dependencies>
        <dependency org="org.springframework" name="spring-beans" rev="2.5.5" transitive="false" conf="webInfLib -> default"/>
        <dependency org="net.sf.json-lib" name="json-lib" rev="2.3"> 
            <artifact name="json-lib" type="jar" m:classifier="jdk15"/>
        </dependency>
    </dependencies>
</ivy-module>

但它总是抛出:
impossible to ivy retrieve: java.lang.RuntimeException: Multiple artifacts of the module xxxxxx are retrieved to the same file! Update the retrieve pattern  to fix this error.

我已经阅读了一些类似的问题,他们建议将检索模式更改为更复杂的模式。我尝试了类似“[artifact]-revision.[ext]”的东西,但没有帮助。当我执行“ivy.resolve”时,它可以正常工作。关于这个问题有什么建议吗?

最佳答案

检索模式是真正的问题。
你在尝试

[artifact]-[revision].ext

所以我想二进制 jar 和源 jar 都将被写在同一个位置,用于任何任意依赖。但是,如果您为您所拥有的案例添加一些独特的东西
[artifact]-[revision](-[classifier]).[ext]

在源或文档的情况下,分类器将具有一个值,因此将具有不同的名称。如果没有分类器(如二进制编译 jar 的情况),则不会有任何分类器,这由括号 ( ) 处理

关于build - Ivy 模块的多个工件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14229246/

相关文章:

javascript - Ant Regex 用文件内容替换模式

php - 预处理 PHP 以从构建的文件中删除功能

ant - Ivy 需要按组织检索文件

ant - Jenkins - 在另一份工作中使用一份工作的结果

java - 具有大量依赖项的项目中依赖项管理的最佳实践

mysql - 搜索用于检查 (My)SQL 语法的工具

gradle - 如何从 GradleBuild 任务中设置另一个 gradle 构建脚本任务的输出文件?

command-line - 为 VC 6 构建命令行?

ant - apache ivy - ivysettings.xml 中有什么

ant - Ant Ivy lib "antlib:org.apache.ivy.ant"的xsd位置,以便使用xsd自动完成IDE?