2012-03-09 13 views
12

ऑफ़लाइन/डिस्कनेक्ट होने पर स्थानीय कैश से निर्भरताओं को हल करने के लिए Ivy कैसे प्राप्त कर सकते हैं (changing="true" के साथ निर्भरता सहित)?ऑफ़लाइन/डिस्कनेक्ट होने पर अपाचे आइवी निर्भरताओं को हल करना?

मैं जावा-आधारित ओपन-सोर्स प्रोजेक्ट पर काम कर रहा हूं जो तृतीय पक्ष निर्भरताओं को हल करने और डाउनलोड करने के लिए अपाचे आइवी का उपयोग करता है। प्रोजेक्ट के build.xml में resolve नामक एक चींटी लक्ष्य है जो आईवी (यदि आवश्यक हो) डाउनलोड करता है और फिर आवश्यक जार को पुनर्प्राप्त करने के लिए आइवी का उपयोग करता है।

सब कुछ ऑनलाइन होने पर बहुत अच्छा काम करता है। हालांकि, इंटरनेट एक्सेस के बिना, ant resolve स्थानीय आइवी कैश (~/.ivy2/cache) में आवश्यक जार हैं, भले ही विफल हो जाएं। ऐसा लगता है कि आइवी changing="true" निर्भरताओं को रीफ्रेश करने के लिए मेवेन रिपोजिटरी से कनेक्ट करने का प्रयास कर रहा है।

[ivy:retrieve] don't use cache for exampleorg#examplename;examplerev: changing=true 

मैं कैसे प्राप्त कर सकते हैं आइवी को हल करने:

[ivy:retrieve] You probably access the destination server through a proxy server that is not well configured. 
[ivy:retrieve] You probably access the destination server through a proxy server that is not well configured. 
[ivy:retrieve] 
[ivy:retrieve] :: problems summary :: 
[ivy:retrieve] :::: WARNINGS 
[ivy:retrieve] Host repo.example.com not found. url=http://repo.example.com/exampleorg/examplename/examplerev/ivys/ivy.xml 
[ivy:retrieve] Host repo.example.com not found. url=http://repo.example.com/exampleorg/examplename/examplerev/jars/examplename.jar 
[ivy:retrieve]   module not found: exampleorg#examplename;examplerev 
[ivy:retrieve] ==== local: tried 
[ivy:retrieve] ~/.ivy2/local/exampleorg/examplename/examplerev/ivys/ivy.xml 
[ivy:retrieve] -- artifact exampleorg#examplename;examplerev!examplename.jar: 
[ivy:retrieve] ~/.ivy2/local/exampleorg/examplename/examplerev/jars/examplename.jar 
[ivy:retrieve] ==== shared: tried 
[ivy:retrieve] ~/.ivy2/shared/exampleorg/examplename/examplerev/ivys/ivy.xml 
[ivy:retrieve] -- artifact exampleorg#examplename;examplerev!examplename.jar: 
[ivy:retrieve] ~/.ivy2/shared/exampleorg/examplename/examplerev/jars/examplename.jar 
[ivy:retrieve] ==== repo: tried 
[ivy:retrieve] http://repo.example.com/exampleorg/examplename/examplerev/ivys/ivy.xml 
[ivy:retrieve] -- artifact exampleorg#examplename;examplerev!examplename.jar: 
[ivy:retrieve] http://repo.example.com/exampleorg/examplename/examplerev/jars/examplename.jar 
[ivy:retrieve]   :::::::::::::::::::::::::::::::::::::::::::::: 
[ivy:retrieve]   ::   UNRESOLVED DEPENDENCIES   :: 
[ivy:retrieve]   :::::::::::::::::::::::::::::::::::::::::::::: 
[ivy:retrieve]   :: exampleorg#examplename;examplerev: not found 
[ivy:retrieve]   :::::::::::::::::::::::::::::::::::::::::::::: 
[ivy:retrieve] 
[ivy:retrieve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS 

BUILD FAILED 
~/exampleproj/build.xml:123: impossible to resolve dependencies: 
     resolve failed - see output for details 

ant -verbose resolve चल रहा है के रूप में चेतावनी प्रिंट उत्पादन में निम्न पंक्ति ने सुझाव दिया:

त्रुटि मैं निम्नलिखित के समान है ऑफ़लाइन होने पर कैश से changing="true" निर्भरता, लेकिन ऑनलाइन होने पर प्रत्येक निर्माण के भंडार से पूछताछ जारी रखें?

+1

मैंने उसमें एक जवाब दिया यह प्रश्न: http://stackoverflow.com/questions/6971517/how-do-i-tell-ivy4r-to-stay-offline – oers

+0

यह दूसरा प्रश्न है। पहले को उत्तर दिया गया है –

+0

@ मार्क: आप सही हैं। मैंने "ivy.cache.ttl.default = etern' को सशर्त रूप से सेट करने के तरीके को हटाने के लिए प्रश्न संपादित किया?" भाग क्योंकि यह एक अलग मुद्दा है। लेकिन मेरा मूल प्रश्न - ऑफ़लाइन होने पर निर्भरताओं को कैसे हल करें - अभी भी अनुत्तरित नहीं है। –

उत्तर

11

ओर्स ने सवाल का जवाब दिया है, लेकिन यह स्पष्ट नहीं है।

ant -Divy.cache.ttl.default=eternal build 

सूत्रों का कहना है:

अपने निर्माण कमांड लाइन से ivy.cache.ttl.default संपत्ति की स्थापना चलाने की कोशिश करें

+0

मुझे उम्मीद है आपको कोई फर्क नहीं पड़ता, मैंने इसे सुधारने के लिए यहां दी गई कुछ जानकारी के साथ अपना उत्तर अपडेट किया। – oers

+0

@oers बिल्कुल ध्यान मत करो। –

+0

उत्तर के लिए धन्यवाद। दुर्भाग्यवश, '-Divy.cache.ttl.default = शाश्वत 'मेरे लिए काम नहीं करता है। कृपया अद्यतन प्रश्न देखें। –