mapping multiple ivy files in Eclipse

2019-08-07 10:08发布

问题:

I'm currently changing my eclipse build paths with Ivy.

I also modified my ANT build successfully by having 2 Ivy files loaded that retrieve my dependencies:

In my portlet build file, I specifically call the common dependencies for all of the portlets which prevents me from specifying the same librairies in every Portlet project:

    <if>
        <available file="${rpm.homedir}/Builder/ivy_portlet.xml" />
        <then>
            <echo message="Getting runtime portlet dependencies using Ivy project's configuration" />
            <ivy:resolve file="${rpm.homedir}/Builder/ivy_portlet.xml"/>
            <ivy:retrieve pattern="${project.lib.dir}/[conf]/[artifact]-[revision](-[classifier]).[ext]" file="${rpm.homedir}/Builder/ivy_portlet.xml"/>
        </then>
        <else>
            <fail message=" file ${rpm.homedir}/Builder/ivy_portlet.xml not found in the builded project." />
        </else>
    </if>

Here's the code from build.xml snippet for all of my projects :

<target name="get-dependencies">
    <if>
        <available file="${basedir}/ivy.xml" />
        <then>
            <echo message="Getting deps using Ivy project's configuration" />
            <ivy:resolve file="${basedir}/ivy.xml"/>
            <ivy:retrieve pattern="${project.lib.dir}/[conf]/[artifact]-[revision](-[classifier]).[ext]" file="${basedir}/ivy.xml"/>
        </then>
        <else>
            <fail message=" file ${basedir}/ivy.xml not found in the builded project." />
        </else>
    </if>
</target>

Everything runs fine with ANT.

How do I set, using IvyIDE plugin, my generic Ivy file located in another project?

回答1:

Use ivy extends http://ant.apache.org/ivy/history/latest-milestone/ivyfile/extends.html

Mark said it, don't create a problem and then try to solve it. You can use extends to use the other ivy-portlet.xml [which resides in a module by itself] with extendType="depenencies"

Use one per project and IvyDE and ivy documentation will be at your side. Try to maneuver and you will find yourself alone.