2012-11-21 13 views
10

मुझे कुछ सीमाओं के कारण पूरी तरह ऑफ़लाइन मैवेन रिपोजिटरी की आवश्यकता है। http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException के अनुसार, केवल <pluginRepositories> प्लगइन के लिए खोजे गए हैं। तो मैं सोच रहा हूं कि एक स्थानीय फाइल सिस्टम में प्लगइन देखने के लिए मेवेन को कैसे कॉन्फ़िगर करना है। मैंने <url> सेट करते समय "फ़ाइल: //" उपसर्ग का उपयोग करने का प्रयास किया लेकिन यह काम नहीं करता है।मैवेन 3 स्थानीय प्लगइन रिपोजिटरी कैसे सेट करें

DEBUG] Verifying availability of /home/dsun/.m2/repository/org/apache/karaf/tooling/features-maven-plugin/2.3.0/features-maven-plugin-2.3.0.jar from [central (http://repo1.maven.org/maven2, releases=true, snapshots=false, managed=false)] 
[ERROR] Plugin org.apache.karaf.tooling:features-maven-plugin:2.3.0 or one of its dependencies could not be resolved: The repository system is offline but the artifact org.apache.karaf.tooling:features-maven-plugin:jar:2.3.0 is not available in the local repository. -> [Help 1] 
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.karaf.tooling:features-maven-plugin:2.3.0 or one of its dependencies could not be resolved: The repository system is offline but the artifact org.apache.karaf.tooling:features-maven-plugin:jar:2.3.0 is not available in the local repository. 

[email protected]:> ls /home/dsun/.m2/repository/org/apache/karaf/tooling/features-maven-plugin/2.3.0/features-maven-plugin-2.3.0.jar 
/home/dsun/.m2/repository/org/apache/karaf/tooling/features-maven-plugin/2.3.0/features-maven-plugin-2.3.0.jar 

settings.xml

<settings>  
<offline>true</offline> 
    <profiles> 
    <profile> 
    <id>local</id> 
    <pluginRepositories> 
     <pluginRepository> 
     <id>central</id> 
     <url>file://${env.HOME}/.m2/repository</url> 
     <releases> 
     <enabled>true</enabled> 
     </releases> 
     <snapshots> 
     <enabled>true</enabled> 
     </snapshots> 
    </pluginRepository> 
    </pluginRepositories> 
    </profile> 
</profiles> 
<activeProfiles> 
    <activeProfile>local</activeProfile> 
</activeProfiles> 

<localRepository>${env.HOME}/.m2/repository</localRepository> 

+1

मुझे यकीन नहीं है, लेकिन शायद यह पोस्ट आपके लिए सहायक होगा: http://stackoverflow.com/questions/5141211/maven-without-remote-repository –

+0

आपकी कॉन्फ़िगरेशन काम नहीं कर सकती क्योंकि आप परिभाषित कर रहे हैं स्रोत भंडार लक्ष्य भंडार (.m2/भंडार) के समान ही है। आपको प्रारंभिक बूट पट्टा होना चाहिए जहां से आपके सभी बिल्ड काम शुरू हो रहे हैं और बाद में आप सेटअप कर सकते हैं। – khmarbaise

+0

हाय खम्बाबाइज, क्या आप इसे विवरण में समझा सकते हैं? आपका मतलब क्या है "स्रोत भंडार"? आवश्यक प्लगइन पहले से ही मेरे स्थानीय भंडार में है। और मैंने को छोड़कर settings.xml में सभी पंक्तियों को निकालने का प्रयास किया, यह भी काम नहीं करता है। – SunLiWei

उत्तर

8

अंत में, मैं समस्या का पता चला है, वहाँ एक फ़ाइल प्लगइन निर्देशिका में _maven.repositories कहा जाता है, के बाद मैं फ़ाइल को नष्ट, सब कुछ ठीक काम करता है !

अधिक जानकारी, निम्नलिखित लिंक देखें:

4

के बाद से Maven 3.1-अल्फा -1, आदेश पंक्ति विकल्प -llr/--legacy-local-repository या सिस्टम प्रॉपर्टी -Dmaven.legacyLocalRepo=true शॉल डी सहायता

+0

स्थानीय रेपो (फाइल सिस्टम) में मेवेन प्लगइन्स खोजने के लिए अच्छी युक्ति;) –

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