【问题标题】:Ivy not retrieving maven-wadl-plugin-1.12.jar常春藤没有检索 maven-wadl-plugin-1.12.jar
【发布时间】:2013-01-12 01:34:31
【问题描述】:

我有一个要在其中实现 Ivy 的项目,但它没有在 ivy:retrieve 命令期间拉下一个依赖项。

ivy.xml 除外:

    <dependency org="com.sun.jersey.contribs"   name="maven-wadl-plugin" rev="1.12" conf="support->default" >
        <!-- artifact name="maven-wadl-plugin" type="jar" /-->
        <exclude org="junit"                    module="junit" />
        <exclude org="org.apache.maven"         module="apache-maven" />
        <exclude org="org.apache.maven"         module="maven-artifact" />
        <exclude org="org.apache.maven"         module="maven-plugin-api" />
        <exclude org="xerces"                   module="xercesImpl" />
    </dependency>

我已经尝试使用和不使用“排除”以确保我没有遗漏任何东西,但是当我删除排除时,它会下载比需要更多的 jar。

我使用 maven-wadl-plugin.jar 为 rest 应用程序生成 WADL。我只是不确定这里到底缺少什么,但我感觉 maven-wadl-plugin pom.xml 和配置中有一些非常复杂的东西。

感谢您提供的任何帮助。

【问题讨论】:

    标签: maven ivy


    【解决方案1】:

    如果你只想要主要的工件,没有它的传递依赖,那么我建议按如下方式编写 ivy 文件:

    <dependencies>
        <dependency org="com.sun.jersey.contribs"   name="maven-wadl-plugin" rev="1.12" conf="support->master"/>
    </dependencies>
    

    神奇的是配置映射:

    conf="support->master"
    

    配置如何映射到 Maven 范围在以下答案中进行了描述:

    特殊的“master”远程配置将没有依赖项,而“default”会下拉额外的编译依赖项。

    常春藤依赖报告

    关于相关问题,我建议使用report 任务来生成依赖报告:

    <target name="resolve" description="Use ivy to resolve classpaths">
        <ivy:resolve/>
        <ivy:report todir='build/ivy' graph='false' xml='false'/>
    </target>
    

    这将了解正在下载的 42 个附加文件与您的原始设置之间的关系。

    【讨论】:

    • 我想通了。类型是 maven-plugin。不是罐子。这就是它会解析但不会检索的原因。非常感谢您提供的信息。
    【解决方案2】:

    我想通了。类型是 maven-plugin。不是罐子。这就是它会解析但不会检索的原因。非常感谢您提供的信息。

    在 build.xml 中,我将 ivy-retrieve 更改如下。

        <ivy:retrieve pattern="${support.dir}/[artifact]-[revision].[ext]" type="maven-plugin,jar,bundle" conf="support"/>
    

    谢谢标记。

    【讨论】:

    • 注意 type="maven-plugin..."。自声明类型是 Ivy 中的另一个危险问题。
    猜你喜欢
    • 2011-10-26
    • 2011-09-07
    • 2017-01-03
    • 1970-01-01
    • 2013-04-26
    • 2013-05-07
    • 2021-06-02
    • 2014-12-21
    • 2013-08-17
    相关资源
    最近更新 更多