2013-01-08 12 views
5

हमारे पास एक पासवर्ड संरक्षित मैवेन रिपोजिटरी है। Http पासवर्ड डाउनलोड करते समय कंसोल पर दिखाया जाता है:मैवेन आर्टिफैक्ट्स डाउनलोड करते समय HTTP पासवर्ड छुपाएं

 
Downloading: https://arved:[email protected]/content/groups/arved/org/apache/xbean/xbean-naming/3.7/xbean-naming-3.7.jar 

क्या किसी भी तरह से पासवर्ड छिपाना संभव है?

+0

इससे पहले कभी नहीं देखा। मेवेन का कौन सा संस्करण आप उपयोग कर रहे हैं और कौन सा मैवेन रिपोजिटरी प्रबंधन सॉफ्टवेयर? –

+2

आपने http पासवर्ड कैसे कॉन्फ़िगर किया? – SpaceTrucker

उत्तर

0

एक तरीका बंदर-पैच यूआरआई :: HTTP होगा। निम्नलिखित कोड में सुधार किया जा सकता है लेकिन सामान्य विचार दिखाता है।

# Patch HTTP.to_s so it does not reveal passwords 
module URI 
    class HTTP 
    def to_s 
     url = '' 
     if @scheme 
     url << @scheme 
     url << ':' 
     end 
     if @host 
     url << '//' 
     end 
     if self.userinfo 
     url << @user 
     if @password 
      url << ':***' 
     end 
     url << '@' 
     end 
     if @host 
     url << @host 
     end 
     if @port 
     url << ':' 
     url << @port.to_s 
     end 
     url << path_query 
     if @fragment 
     url << '#' 
     url << @fragment 
     end 
     url 
    end 
    end 
end 
3

आपका भंडार विन्यास (यूआरएल) शायद गलत है, इस पेज को देखने के: http://maven.apache.org/guides/mini/guide-encryption.html (एन्क्रिप्शन वैकल्पिक है)

सभी आपको क्या चाहिए $ HOME/.m2/सेटिंग्स करने के लिए पासवर्ड डाल करने के लिए है pom.xml में .xml

<settings> 
... 
    <servers> 
... 
    <server> 
     <id>arved-repository</id> 
     <username>arved</username> 
     <password>passw0rd</password> 
    </server> 
... 
    </servers> 
... 
</settings> 

और कॉन्फ़िगर भंडार परिभाषित का उपयोग कर पहले server.id:

+०१२३५१६४१०६
<project> 
... 
    <repositories> 
    <repository> 
     <id>arved-repository</id> 
     <name>Arved Repository</name> 
     <url>https://maven.arved.at/content/groups/arved</url> 
    </repository> 
... 
</project> 
संबंधित मुद्दे