2012-10-01 11 views
23

संभव डुप्लिकेट:
Ivy fails to resolve a dependancy, unable to find causeचींटी लक्ष्य विफल: एंटीलिब या आइवी मुद्दा?

मैं निम्नलिखित निर्माण कार्य को चलाने के लिए कोशिश कर रहा हूँ (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> 

जब मैं ant -buildfile build.xml initIvy चलाने मैं निम्नलिखित आउटपुट प्राप्त :

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 

जब मैं $ {ANT_HOME}/lib पर जाता हूं, तो मुझे "एंटीलिब * .jar" लेबल वाले किसी भी JARs दिखाई नहीं देते हैं।

तो मैं अनुमान लगा रहा हूं मैंने एंट का एक संस्करण डाउनलोड किया जिसमें एंटीलिब शामिल नहीं था, और अब मैं आईवी (जो एंटीलिब का उपयोग करता हूं) का उपयोग कर रहा हूं, निर्माण चौंकाने वाला है?

यदि यह एंटीलिब मुद्दा है, तो मुझे विश्वास है कि मैं here उपलब्ध डिस्ट्रोज़ में से एक चाहता हूं। यदि हां, तो क्या कोई यह पुष्टि कर सकता है कि मुझे किस का उपयोग करना चाहिए (जिसमें केवल एंटीलिब है और कुछ भी नहीं), और इसे स्थापित करने की प्रक्रिया की पुष्टि करें; यानी, क्या यह सही जार को $ {ANT_HOME}/lib में डालने जैसा आसान है? आदि

यदि यह एक आइवी मुद्दा है, तो क्या कोई मुझे सही दिशा में इंगित कर सकता है कि क्या हो रहा है?

और यदि यह न तो एंटीलिब और न ही आइवी है, तो सीधे ऊपर दिए गए प्रश्न के लिए। अग्रिम में धन्यवाद!

उत्तर

55

मुझे लगता है कि आप अपाचे IVY लाइब्रेरी गायब हो सकते हैं। इसे यहां से डाउनलोड करें - apache ivy अपनी चींटी lib निर्देशिका में जार की प्रतिलिपि बनाएँ।

उदाहरण के लिए (के रूप में उपयुक्त परिवर्तन संस्करण संख्या):

  1. डाउनलोड और इंस्टॉल करें चींटी (जैसे, C:\Apps\Tools\apache-ant-1.9.7)।
  2. डाउनलोड करें और C:\Apps\Tools\apache-ant-1.9.7\lib में आइवी (जैसे, C:\Users\UserName\Downloads\apache-ivy-2.4.0)
  3. कॉपी C:\Users\UserName\Downloads\apache-ivy-2.4.0\ivy-2.4.0.jar निकालें।

चींटी आइवी का उपयोग करने के लिए कॉन्फ़िगर किया गया है।

+0

डांग - वह था। मैंने आइवी जार की प्रतिलिपि बनाने के लिए भूल गए, आईवी लिब जार की प्रतिलिपि बनाई थी। जिज्ञासा से बाहर, यह क्या था जिसने आपको (दाएं) विचार दिया? अगली बार सीखने की कोशिश कर रहा हूं कि मैं खुद समस्या का निदान कर सकता हूं! एक बार फिर धन्यवाद! – IAmYourFaja

+3

@ 4herpsand7derpsago [antlib] (https://ant.apache.org/manual/Types/antlib.html) चींटी में एक सामान्य शब्द है और एक अलग उपकरण नहीं है। अगर आपको "संसाधन संगठन/apache/ivy/ant/antlib.xml से परिभाषाएं लोड नहीं हो पातीं।" "नहीं मिल सका तो इसका मतलब है कि क्लासपाथ में कोई जार फ़ाइल नहीं है, जिसमें" org /apache/ivy/ant/antlib.xml "। और क्योंकि यह फ़ाइल ivy.xml का हिस्सा है, आप जानते हैं कि lib गुम है। – oers

+5

[आइवी ग्रहण अद्यतन साइट] का उपयोग करना एक और अधिक विश्वसनीय तरीका है (http://www.apache.org/dist/ant/ivyde/updatesite) - "अपाचे आईवी" -लिब्स (अपाचे आईवी और अपाचे आईवी एंटी टैक्स) दोनों स्थापित करें – teclis

संबंधित मुद्दे