Subversion Repositories SmartDukaan

Rev

Rev 35294 | Rev 35488 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35294 Rev 35381
Line 158... Line 158...
158
    public PropertySourcesPlaceholderConfigurer propertyConfigurer1() {
158
    public PropertySourcesPlaceholderConfigurer propertyConfigurer1() {
159
        String activeProfile = getActiveProfile();
159
        String activeProfile = getActiveProfile();
160
 
160
 
161
        PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
161
        PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
162
 
162
 
-
 
163
        Resource appResource;
-
 
164
        Resource sharedResource;
-
 
165
 
163
        if ("prod".equals(activeProfile)) {
166
        if ("prod".equals(activeProfile)) {
164
            resource = new ClassPathResource("/META-INF/prod.properties");
167
            appResource = new ClassPathResource("/META-INF/prod.properties");
-
 
168
            sharedResource = new ClassPathResource("/shared-prod.properties");
165
        } else if ("staging".equals(activeProfile)) {
169
        } else if ("staging".equals(activeProfile)) {
166
            resource = new ClassPathResource("/META-INF/staging.properties");
170
            appResource = new ClassPathResource("/META-INF/staging.properties");
-
 
171
            sharedResource = new ClassPathResource("/shared-staging.properties");
167
        } else {
172
        } else {
168
            resource = new ClassPathResource("/META-INF/dev.properties");
173
            appResource = new ClassPathResource("/META-INF/dev.properties");
-
 
174
            sharedResource = new ClassPathResource("/shared-dev.properties");
169
        }
175
        }
170
 
176
 
-
 
177
        resource = appResource;
-
 
178
 
-
 
179
        // Load shared properties from dao first, then app-specific (app-specific can override)
171
        propertySourcesPlaceholderConfigurer.setLocation(resource);
180
        propertySourcesPlaceholderConfigurer.setLocations(sharedResource, appResource);
-
 
181
        propertySourcesPlaceholderConfigurer.setIgnoreResourceNotFound(true);
172
 
182
 
173
        return propertySourcesPlaceholderConfigurer;
183
        return propertySourcesPlaceholderConfigurer;
174
    }
184
    }
175
 
185
 
176
    private String getActiveProfile() {
186
    private String getActiveProfile() {