spring                
            संपत्ति का स्रोत
        
        
            
    खोज…
टिप्पणी
नमूना संपत्ति फ़ाइल: nexus.properties
नमूना संपत्ति फ़ाइल सामग्री:
nexus.user=admin
nexus.pass=admin
nexus.rest.uri=http://xxx.xxx.xxx.xxx:xxxx/nexus/service/local/artifact/maven/content
नमूना संदर्भ फ़ाइल xml कॉन्फ़िगरेशन
<context:property-placeholder location="classpath:ReleaseBundle.properties" />
एनोटेशन का उपयोग कर नमूना संपत्ति बीन
@Component
@PropertySource(value = { "classpath:nexus.properties" })
public class NexusBean {
    @Value("${" + NexusConstants.NEXUS_USER + "}")
    private String user;
    @Value("${" + NexusConstants.NEXUS_PASS + "}")
    private String pass;
    @Value("${" + NexusConstants.NEXUS_REST_URI + "}")
    private String restUri;
}
नमूना निरंतर वर्ग
public class NexusConstants {
    public static final String NexusConstants.NEXUS_USER="";
    public static final String NexusConstants.NEXUS_PASS="";
    public static final String NexusConstants.NEXUS_REST_URI="";
}
PropertyPlaceholderConfigurer का उपयोग करके नमूना xml कॉन्फ़िगरेशन
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
     <list>
           <value>classpath:ReleaseBundle.properties</value>
     </list>
</bean>
Modified text is an extract of the original Stack Overflow Documentation
        के तहत लाइसेंस प्राप्त है CC BY-SA 3.0
        से संबद्ध नहीं है Stack Overflow