Ant target failing: Antlib o Ivy issue? [duplicar]


Posible Duplicado:
Ivy no resuelve una dependencia, incapaz de encontrar la causa

Estoy intentando ejecutar la siguiente tarea de compilación(initIvy):

<?xml version="1.0" encoding="UTF-8"?>
<project name="myproject-build" default="package" basedir=".." xmlns:ivy="antlib:org.apache.ivy.ant">
    <property file="build/build.properties"/>
    <property environment="env"/>

    <!-- Ant library path, including all of its plugins. -->
    <path id="ant.lib.path">
        <fileset dir="${env.ANT_HOME}/lib" includes="*.jar"/>
    </path>

    <!-- CONFIGURE IVY -->
        <taskdef resource="org/apache/ivy/ant/antlib.xml"
            uri="antlib:org.apache.ivy.ant" classpathref="ant.lib.path"/>

    <!-- Use Ivy tasks to resolve dependencies into the local Ivy cache. -->
    <target name="initIvy">
        <!-- Initialize Ivy and connect to host repository. -->
        <echo message="Initializing Apache Ivy and connecting to the host repository."/>
        <ivy:settings url="${ivy.std.repo.settings.url}" realm="${ivy.std.repo.realm}" username="${ivy.std.repo.username}" passwd="${ivy.std.repo.password}"/>

        <!-- Clear/flush the Ivy cache. -->
        <echo message="Cleaning the local Ivy cache for the current build."/>
        <ivy:cleancache/>
    </target>

    <!-- Rest of buildfile omitted for brevity. -->

</project>

Cuando corro ant -buildfile build.xml initIvy obtengo la siguiente salida:

Buildfile: /<path-to-my-project>/build/build.xml
    [taskdef] Could not load definitions from resource org/apache/ivy/ant/antlib.xml. It could not be found.

initIvy:
    [echo] Initializing Apache Ivy and connecting to the host repository.

BUILD FAILED
/<path-to-my-project>/build/build.xml:81: Problem: failed to create task or type antlib:org.apache.ivy.ant:settings
    Cause: The name is undefined.
    Action: Check the spelling.
    Action: Check that any custom tasks/types have been declared.
    Action: Check that any <presetdef>/<macrodef> declarations have taken place.
    No types or tasks have been defined in this namespace yet

This appears to be an antlib declaration. 
Action: Check that the implementing library exists in one of:
    -/<path-to-my-ANT_HOME>/lib
    -/home/myUser/.ant/lib
    -a directory added on the command line with the -lib argument

Cuando voy a li{ANT_HOME}/lib, no veo ningún tarro etiquetado como "antlib*.frasco".

Así que estoy adivinando Descargué una versión de Ant que no incluía Antlib, y ahora que estoy usando Ivy (que usa Antlib), ¿se está ahogando?

Si este es un problema de Antlib, entonces creo que quiero una de las distribuciones disponibles aquí. Si es así, ¿puede alguien confirmar cuál debo usar (que solo contiene Antlib y no cualquier otra cosa), y confirmar el proceso para instalarlo; es decir, ¿es tan simple como poner el TARRO correcto en {{ANT_HOME}/lib? Sucesivamente.

Si esto es un asunto de Ivy, entonces alguien puede indicarme en la dirección correcta en cuanto a lo que podría estar pasando?

Y si esto es ni Antlib ni Ivy, lo mismo para la pregunta de arriba. Gracias de antemano!

 23
Author: Community, 2012-10-01

1 answers

Creo que te estás perdiendo la biblioteca Apache IVY. Descárguelo desde aquí- apache ivy Copie el jar en su directorio ant lib.

Por ejemplo (cambie los números de versión según corresponda):

  1. Descargue e instale Ant (por ejemplo, C:\Apps\Tools\apache-ant-1.9.7).
  2. Descargar y extraer Hiedra (e. g., C:\Users\UserName\Downloads\apache-ivy-2.4.0)
  3. Copiar C:\Users\UserName\Downloads\apache-ivy-2.4.0\ivy-2.4.0.jar en C:\Apps\Tools\apache-ant-1.9.7\lib.

Ant está configurado para usar Ivy.

 57
Author: Shwetanka,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-04-29 23:24:21