Maven3

2011-01-22 5 views
8

में सक्रिय प्रोफाइल निर्दिष्ट करने के लिए कैसे करें हमारे एप्लिकेशन में विभिन्न सक्रिय प्रोफाइल शामिल हैं (ए 1, ए 2, ए 3, ए 5 ...) जिन्हें अलग-अलग प्रोफाइल.एक्सएमएल फ़ाइल में परिभाषित किया गया था। मेवेन 3 उम्मीद करता है कि सभी प्रोफाइल जानकारी pom.xml फ़ाइल के हिस्से के रूप में संग्रहीत की जाएंगी।Maven3

मैं कैसे ताकि मैं उन्हें आदेश पंक्ति में निर्दिष्ट करने से बच सकते हैं एक pom.xml फ़ाइल के भीतर सक्रिय प्रोफ़ाइल की सूची निर्दिष्ट करना चाहिए, (जैसे mvn -PA1, A2, A3, ए 5)

उत्तर

8

ऐसा करने चाहिए यह:

<profiles> 
    <profile> 
    <id>profile-1</id> 
    <activation> 
     <activeByDefault>true</activeByDefault> 
    </activation> 
    ... 
    </profile> 
</profiles> 

here से।

+0

मैं एकाधिक प्रोफाइल के लिए इसे निर्दिष्ट करने में असमर्थ हूं, मुझे नहीं लगता कि सुझाव काम करता है – user339108

4

@ javamonkey79 के उत्तर में अतिरिक्त आप सेटिंग्स.xml का उपयोग कर सकते हैं। प्रोफाइल और सक्रियण के कुछ हिस्सों हैं। निम्नलिखित उदाहरण देखें:

<profiles> 
    <profile> 
    <id>hudson-simulate</id> 
    <properties> 
    <gituser>username</gituser> 
    <gitpassword>secret</gitpassword> 
    </properties> 
    </profile> 
    <profile> 
    <id>other-profile</id> 
    <properties> 
    <proerty1>username</property1> 
    </properties> 
    </profile> 
</profiles> 

<activeProfiles> 
    <activeProfile>hudson-simulate</activeProfile> 
    <activeProfile>other-profile</activeProfile> 
</activeProfiles> 
संबंधित मुद्दे