2011-02-25 12 views
15

मैं ग्रहण में Maven का उपयोग कर रहा रखने के लिए स्थापित (एम 2 ग्रहण)mvn: गठजोड़ दूरस्थ भंडार में मेरी जार

जब मैं mvn निष्पादित करें: स्थापित मैं अपने जार (विरूपण साक्ष्य) गठजोड़ भंडार है जो में स्थापित किया जा करना चाहते हैं सर्वर पर स्थित (अभी स्थापित स्थापित जार स्थानीय सिस्टम भंडार में रखा गया है) .. मैं यह कैसे कर सकता हूं?

enter image description here

मैं भी

उत्तर

22

आमतौर पर अपने स्थानीय भंडार का पता करने के लिए इस बदल गया है, आप mvn deploy का उपयोग करेंगे एक गैर-स्थानीय भंडार को तैनात करने के लिए।

आपको निश्चित रूप से रेपो कॉन्फ़िगर करने की आवश्यकता होगी, या तो आपके maven settings.xml या प्रोजेक्ट पीओएम में।

जैसा कि हम हमेशा एक ही आंतरिक रेपो का उपयोग करते हैं, मैंने इसे मैवेन सेटिंग्स.एक्सएमएल में किया है, अधिक सटीक रूप से, "प्रोफ़ाइल" अनुभाग।

<profiles> 
    <profile> 
     <id>artifactory</id> 
     <repositories> 
     <repository> 
      <id>central</id> 
      <name>libs-releases</name> 
      <url>http://repo.example.com/libs-releases</url> 
      <snapshots> 
      <enabled>false</enabled> 
      </snapshots> 
     </repository> 
     <repository> 
      <id>snapshots</id> 
      <name>libs-snapshots</name> 
      <url>http://repo.example.com/libs-snapshots</url> 
      <snapshots /> 
     </repository> 
     </repositories> 
     <pluginRepositories> 
     <pluginRepository> 
      <id>central</id> 
      <name>plugins-releases</name> 
      <url>http://repo.example.com/plugins-releases</url> 
      <snapshots><enabled>false</enabled></snapshots> 
     </pluginRepository> 
     </pluginRepositories> 
    </profile> 
    </profiles> 
    <activeProfiles> 
    <activeProfile>artifactory</activeProfile> 
    </activeProfiles> 
:

यहाँ संदर्भ के लिए मेरी config है