Java 如何获得对常春藤的依赖

Java 如何获得对常春藤的依赖,java,build-process,ivy,Java,Build Process,Ivy,我正在审查我们申请中常春藤的使用情况。我已经设置了一个简单的配置来拉下cobertura <ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"> <info organisation="com"

我正在审查我们申请中常春藤的使用情况。我已经设置了一个简单的配置来拉下cobertura

<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
    <info
        organisation="com"
        module="adesa"
        status="integration">
    </info>
    <configurations>
        <conf name="runtime" description=""/>
    </configurations>
    <dependencies>
      <dependency org="cobertura" name="cobertura" rev="1.8" transitive="true"/>
    </dependencies> 
</ivy-module>

我知道cobertura依赖于其他jar文件。那么如何获取其他jar文件呢?我在缓存目录中看到的唯一东西是coberturajar文件

这是我的ivysetting.xml

<ivysettings>
<settings defaultResolver="chained" />
<resolvers>
    <chain name="chained" returnFirst="true"> 
        <url name="apache" m2compatible="true"> 
            <!--Apache -->
            <artifact pattern="http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            <artifact pattern="http://people.apache.org/repo/m2-incubating-repository/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        </url>
        <url name="jboss" m2compatible="true">  
            <!-- JBoss -->
            <artifact pattern="http://repository.jboss.com/maven2/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        </url>

        <ibiblio name="ibiblio" m2compatible="true" /> 
        <url name="mvnrepos" m2compatible="true">
            <!-- IBIBLIO-Mirror -->
            <artifact pattern="http://mirrors.ibiblio.org/pub/mirrors/maven2/[organisation]/[module]/[branch]/[revision]/[branch]-[revision].[ext]" />
        </url>
    </chain> 
</resolvers> 

是否有其他可用于获取依赖项/JAR的存储库列表


build.xml文件中的代码段:

    <target name="load-ivy">
    <path id="ivy.lib.path">
        <fileset dir="${basedir}/lib" includes="*.jar"/>
    </path>
    <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>

<target name="ivy-init" depends="load-ivy">
    <mkdir dir="${dest.repo.dir}"/>
    <ivy:settings id="basic.settings" file="${basedir}/ivysettings.xml"/>
</target>

<target name="ivy-clean" depends="ivy-init">
    <ivy:cleancache settingsRef="basic.settings"/>
    <delete dir="${ivy.cache.dir}" failonerror="true"  />
    <delete dir="${dest.repo.dir}"/>
</target>


<target name="ivy-download" depends="ivy-clean,ivy-init">
    <ivy:retrieve  settingsRef="basic.settings" pattern="${dest.repo.dir}/[artifact]/[artifact]-[revision].[ext]" />
</target>

<target name="ivy-report" depends="ivy-download">
    <ivy:report  settingsRef="basic.settings" todir="${basedir}/logs" />
</target>

您的配置与我的配置非常相似,只是我对cobertura有不同的依赖关系:

<dependency org="net.sourceforge.cobertura" name="cobertura" rev="1.9" conf="cobertura"/>


我还建议您在添加额外的存储库之前尝试使用默认的ivysettings.xml


示例代码段 Ivy类路径解析:

使用常春藤路径进行编译


使用您的设置,我总是得到:无法解决依赖项:消息。我删除了对ivysettings.xml的任何引用,并在输出中看到消息将使用默认实例。我已使用部分构建文件编辑了orig消息。我用mvnrepps的新模式修改了我的ivysettings.com,它允许我使用您的依赖关系。“/>”/>你把常春藤放在哪里:解决?你能把build.xml和ivy.xml的结构作为参考模型发布回去吗?谢谢,我在我的ivy.xml文件中添加了以下内容:这似乎可以减少所有依赖项
<target name="init.deps" description="Download (if needed) and resolve the dependencies." unless="deps.init">

    <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.file}" />

    <ivy:resolve />
    <ivy:cachepath pathid="ivy.path" conf="production" />

    <property name="deps.init" value="true"/> <!-- guard against multiple ivy computations -->

</target>
<target name="compile" depends="init, record-build-number">
    <javac srcdir="src" debug="true" destdir="build/classes">
        <classpath>
            <path refid="ivy.path" />
        </classpath>
    </javac>
</target>