【问题标题】:Ant Ivy: How to retrieve source code for all levels of dependencies?Ant Ivy:如何检索所有级别依赖项的源代码?
【发布时间】:2014-07-11 07:57:00
【问题描述】:

我尝试配置 Ivy 以下载依赖项的源代码。它有效,但仅适用于顶级依赖项。 Maven 将获取所有级别依赖项的源代码。如何使用 Ivy 做到这一点?

这是我的 ivy.xml 文件:

<ivy-module version="2.0">
    <info organisation="com.ubs" module="IMQuant"/>
    <dependencies defaultconfmapping="*->default,sources">
        <dependency org="junit" name="junit" rev="4.11"/>
        <dependency org="org.apache.maven.surefire" name="common-java5" rev="2.17"/>
        <dependency org="com.googlecode.kevinarpe-papaya" name="kevinarpe-papaya" rev="0.0.15"/>
    </dependencies>
</ivy-module>

这是我的检索声明:

<ivy:retrieve pattern="${libs.dir}/ivy/all/[artifact]-[revision]-[type].[ext]" />

以上,依赖 kevinarpe-papaya 需要 Google Guava。我看到下载的 JAR(实际上是一个包),但我没有看到源代码。我检查了我的常春藤缓存。 Google Guava 的来源也丢失了。

另外,依赖 junit 需要 Hamcrest(核心)。同样,我看到下载的 JAR,但我没有看到源代码。 (另外,我检查了我的 Ivy 缓存。)

【问题讨论】:

    标签: java ant ivy


    【解决方案1】:

    您可以尝试指定类型:

    type="sources"
    

    例如:

    <dependency org="junit" name="junit" type="sources" rev="4.11"/>
    

    如果要检索不同的类型,请多次提及同一个依赖项:

    <dependency org="junit" name="junit" type="sources" rev="4.11"/>
    <dependency org="junit" name="junit" type="jar" rev="4.11"/>
    

    【讨论】:

      猜你喜欢
      • 2023-03-25
      • 1970-01-01
      • 2011-05-14
      • 2013-10-09
      • 2013-04-20
      • 2011-01-18
      • 1970-01-01
      • 2011-06-24
      • 1970-01-01
      相关资源
      最近更新 更多