Project

General

Profile

Download (1.57 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2021 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.api.config;
10

    
11
import org.springframework.context.annotation.Configuration;
12
import org.springframework.context.annotation.PropertySource;
13
import org.springframework.context.annotation.PropertySources;
14

    
15
/**
16
 * Centralizes the application configuration properties for all <code>@Configuration</code> beans.
17
 *
18
 * The default configuration in {@code classpath:/application.properties} can be overwritten
19
 * by {@code file:/${user.home}/.cdmLibrary/application-dev.properties} for development purposes.
20
 * For production environments it is recommended to use system properties instead.
21
 *
22
 * Mimics the spring boot auto-configuration capabilities to some very basic extend.
23
 *
24
 * Can be replaced once we are using spring boot.
25
 *
26
 * The property source file <code>application.properties</code> may be placed in
27
 * <code>src/test/resources</code> and <code>src/main/resources</code>
28
 *
29
 * @author a.kohlbecker
30
 * @since Sep 15, 2021
31
 */
32
@Configuration
33
@PropertySources({
34
    // classpath:/application.properties as first
35
    @PropertySource("classpath:/application.properties"),
36
    // allows application-dev.properties to override the default settings !!!
37
    @PropertySource(value="file:${user.home}/.cdmLibrary/application-dev.properties", ignoreResourceNotFound = true)
38
})
39
public class AppConfigurationPropertiesConfig {
40

    
41
}
(2-2/9)