2015-03-11 3 views
5

उदाहरण के लिए, जब मैं एक्लिप्स में एक अच्छी तरह से विकसित ओपनसोर्स प्रोजेक्ट (ल्यूसीन) खोलता हूं (दोनों चींटी build.xml और ivy ivysetting.xml के साथ), मैं पूरी परियोजना को सफलतापूर्वक बनाने के लिए build.xml के साथ चींटी चला सकता हूं।क्या ivy या ivyDE जावास्क्रिप्ट में स्वचालित रूप से JAVA बिल्ड पथ लाइब्रेरी में संबंधित जार जोड़ सकते हैं?

हालांकि, परियोजना .java कक्षाओं की गड़बड़ी में त्रुटियों से भरा है। यह बाहरी जारों को अनलिंक करने के कारण होता है। ये जार पहले से ही आईवी द्वारा डाउनलोड किए गए हैं और {उपयोगकर्ता} /। Ivy2/कैश/में संग्रहीत हैं। साथ ही, जब मैं मैन्युअल रूप से इन जारों को इस परियोजना के निर्माण पथ में डालता हूं, तो त्रुटियां समाप्त हो जाती हैं।

क्या आईवी या ivyDE या कुछ अन्य टूल्स जार को जावा बिल्ड पथ में स्वचालित रूप से रख सकते हैं? > आइवी - -> प्राथमिकताएं

<!-- 
 
    Licensed to the Apache Software Foundation (ASF) under one 
 
    or more contributor license agreements. See the NOTICE file 
 
    distributed with this work for additional information 
 
    regarding copyright ownership. The ASF licenses this file 
 
    to you under the Apache License, Version 2.0 (the 
 
    "License"); you may not use this file except in compliance 
 
    with the License. You may obtain a copy of the License at 
 

 
    http://www.apache.org/licenses/LICENSE-2.0 
 

 
    Unless required by applicable law or agreed to in writing, 
 
    software distributed under the License is distributed on an 
 
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
 
    KIND, either express or implied. See the License for the 
 
    specific language governing permissions and limitations 
 
    under the License.  
 
--> 
 
<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="" 
 
     module="lucene-5.0.0" 
 
     status="integration"> 
 
\t </info> 
 
<ivysettings> 
 
    <settings defaultResolver="default"/> 
 
    
 
    <property name="local-maven2-dir" value="${user.home}/.m2/repository/" /> 
 
    
 
    <properties file="${ivy.settings.dir}/ivy-versions.properties" override="false"/> 
 
    
 
    <include url="${ivy.default.settings.dir}/ivysettings-public.xml"/> 
 
    <include url="${ivy.default.settings.dir}/ivysettings-shared.xml"/> 
 
    <include url="${ivy.default.settings.dir}/ivysettings-local.xml"/> 
 
    <include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml"/> 
 

 
    <caches lockStrategy="artifact-lock" resolutionCacheDir="${common.build.dir}/ivy-resolution-cache" /> 
 

 
    <resolvers> 
 
    <ibiblio name="sonatype-releases" root="https://oss.sonatype.org/content/repositories/releases" m2compatible="true" /> 
 
    <ibiblio name="maven.restlet.org" root="http://maven.restlet.org" m2compatible="true" /> 
 
    <ibiblio name="releases.cloudera.com" root="http://repository.cloudera.com/content/repositories/releases" m2compatible="true" /> 
 
    
 
    <!-- needed only for newer svnkit releases, e.g. 1.8.x --> 
 
    <ibiblio name="svnkit-releases" root="http://maven.tmatesoft.com/content/repositories/releases" m2compatible="true" /> 
 

 
    <!-- you might need to tweak this from china so it works --> 
 
    <ibiblio name="working-chinese-mirror" root="http://uk.maven.org/maven2" m2compatible="true" /> 
 
    
 
    <!-- 
 
    <filesystem name="local-maven-2" m2compatible="true" local="true"> 
 
     <artifact 
 
      pattern="${local-maven2-dir}/[organisation]/[module]/[revision]/[module]-[revision].[ext]" /> 
 
     <ivy 
 
      pattern="${local-maven2-dir}/[organisation]/[module]/[revision]/[module]-[revision].pom" /> 
 
    </filesystem> 
 
    --> 
 

 
    <chain name="default" returnFirst="true" checkmodified="true" changingPattern=".*SNAPSHOT"> 
 
     <resolver ref="local"/> 
 
     <!-- <resolver ref="local-maven-2" /> --> 
 
     <resolver ref="main"/> 
 
     <resolver ref="maven.restlet.org" /> 
 
     <resolver ref="sonatype-releases" /> 
 
     <resolver ref="releases.cloudera.com"/> 
 
     <!-- <resolver ref="svnkit-releases" /> --> 
 
     <resolver ref="working-chinese-mirror" /> 
 
    </chain> 
 
    </resolvers> 
 

 
</ivysettings> 
 
</ivy-module>

उत्तर

-1

आप अपने प्रोजेक्ट को ivysettings.xml फ़ाइल जोड़ सकते हैं और वरीयताओं में यह सेट (विंडो की जरूरत है:

यहाँ लताओं से setting.xml है -> सेटिंग्स: आइवी सेटिंग्स पथ)। जब यह अनुपस्थित है, आईवी को पता नहीं है कि निर्भरताओं को कहां देखना है।

(शायद यह अपनी परियोजनाओं में से एक के लिए फ़ाइल जोड़ने के लिए पर्याप्त है, लेकिन मुझे यकीन है कि नहीं कर रहा हूँ।)

1

यह होगा यदि आप Ivy Eclipse plugin का उपयोग करें। यदि आपने इसे इंस्टॉल किया है, तो आपको परियोजना के निर्माण पथ में आईवीवाई रनटाइम जोड़ना होगा। यह परियोजना गुणों के माध्यम से किया जा सकता है-> लाइब्रेरी टैब के अंतर्गत जावा बिल्ड पथ, लाइब्रेरी जोड़ें का चयन करें और फिर IvyDE प्रबंधित निर्भरता का चयन करें।

एक बार ऐसा करने के बाद, एक आइवी संकल्प परियोजना के निर्माण पथ में ivy.xml में निर्दिष्ट सभी जार जोड़ देगा।

+0

यह वैसे भी काम नहीं करता .. –

+0

मेरा आईवीडीई 2.2 है, और यह परियोजना गुणों के माध्यम से किया जाता है-> पुस्तकालय टैब के तहत जावा बिल्ड पथ, लाइब्रेरी जोड़ें का चयन करें और फिर IvyDE प्रबंधित निर्भरता का चयन करें। और, मुख्य: आइवी फ़ाइल: ivy-setting.xml, क्लासपाथ: "प्रोजेक्ट निर्दिष्ट सेटिंग्स सक्षम करें" की जांच की गई, और "वर्कस्पेस में निर्भरता को हल करें" की जांच की। हालांकि, जब मैं परियोजना को हल करता हूं तो यह काम नहीं करता है। जोड़ें मैंने xml फ़ाइल को प्रश्न के विवरण में जोड़ा है। –

+0

किस तरह से "यह काम नहीं किया"? क्या आपको किसी प्रकार की त्रुटि मिली? क्या आप क्लासपाथ में आइवी लाइब्रेरी देखते हैं? क्या इसमें कोई जार है? –

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