1

変なものに出会いました。ivy retrieve タグを使用して、jar をどこかに配置します。次のようなコードを記述した場合:

    <target name="test">
        <ivy:retrieve pattern="lib/[artifact](.[ext])" sync="true" type="jar" conf="webInfLib"/>
    </target>

それはうまくいきます。しかし、以下のようなものを追加すると:

    <target name="test">
        <ivy:cachepath pathid="ivy.path" />
        <ivy:retrieve pattern="lib/[artifact](.[ext])" sync="true" type="jar" conf="webInfLib"/>
    </target>

「依存関係を解決できません」がスローされます。助言がありますか?ありがとう。

4

1 に答える 1

0

問題を再現できません。アイビーのどのバージョンを使用していますか?

次のソフトウェア バージョンを使用しました。

Apache Ant(TM) version 1.8.2
Apache Ivy 2.3.0-rc2

build.xml

<project name="demo" default="build" xmlns:ivy="antlib:org.apache.ivy.ant">

    <target name="init" description="Use ivy to resolve classpaths">
        <ivy:cachepath pathid="ivy.path" />
        <ivy:retrieve pattern="lib/[artifact](.[ext])" sync="true" type="jar" conf="webInfLib"/>
    </target>

    <target name="build" depends="init" description="build project">
    </target>

    <target name="clean" description="Cleanup build files">
        <delete dir="lib"/>
    </target>

    <target name="clean-all" depends="clean" description="Additionally purge ivy cache">
        <ivy:cleancache/>
    </target>

</project>

アイビー.xml

<ivy-module version="2.0">
    <info organisation="com.myspotontheweb" module="demo"/>

    <configurations>
        <conf name="webInfLib"  description="add jar to web-inf/lib folder"/>
    </configurations>
    <dependencies>
        <dependency org="javax.servlet" name="servlet-api" rev="2.4" conf="webInfLib->default"/>
    </dependencies>

</ivy-module>
于 2013-01-10T21:55:25.193 に答える