Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
9d0ac868
Commit
9d0ac868
authored
Mar 21, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
03667c7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
15 deletions
+12
-15
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+8
-8
EnumerableCompositePropertySource.java
...framework/boot/env/EnumerableCompositePropertySource.java
+1
-1
PropertySourcesLoader.java
...a/org/springframework/boot/env/PropertySourcesLoader.java
+3
-6
No files found.
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
9d0ac868
...
...
@@ -276,14 +276,14 @@ or
$ java -jar myproject.jar --spring.config.location=classpath:/default.properties,classpath:/override.properties
----
If `spring.config.location` contains directories (as opposed to files)
they should end in "/" (and will be appended with the names generated
from `spring.config.name` before being loaded). The default search
path `classpath:,classpath:/config,file:,file:config/` is always used,
irrespective of the value of `spring.config.location`. In that way you
can set up default values for your app in `application.properties` (or
whatever other basename you choose with `spring.config.name`) and
override it at runtime with a different file, keeping the defaults.
If `spring.config.location` contains directories (as opposed to files)
they should end
in `/` (and will be appended with the names generated from `spring.config.name` before
being loaded). The default search path `classpath:,classpath:/config,file:,file:config/`
is always used, irrespective of the value of `spring.config.location`. In that way you
can set up default values for your application in `application.properties` (or whatever
other basename you choose with `spring.config.name`) and override it at runtime with a
different file, keeping the defaults.
[[boot-features-external-config-profile-specific-properties]]
...
...
spring-boot/src/main/java/org/springframework/boot/env/EnumerableCompositePropertySource.java
View file @
9d0ac868
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
4
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
spring-boot/src/main/java/org/springframework/boot/env/PropertySourcesLoader.java
View file @
9d0ac868
...
...
@@ -68,26 +68,24 @@ public class PropertySourcesLoader {
* @throws IOException
*/
public
PropertySource
<?>
load
(
Resource
resource
)
throws
IOException
{
return
this
.
load
(
resource
,
null
);
return
load
(
resource
,
null
);
}
/**
* Load the profile-specific properties from the specified resource (if any) and add
* it as the first source.
*
* @param resource the source resource (may be {@code null}).
* @param profile a specific profile to load or {@code null} to load the default.
* @return the loaded property source or {@code null}
* @throws IOException
*/
public
PropertySource
<?>
load
(
Resource
resource
,
String
profile
)
throws
IOException
{
return
this
.
load
(
resource
,
resource
.
getDescription
(),
profile
);
return
load
(
resource
,
resource
.
getDescription
(),
profile
);
}
/**
* Load the profile-specific properties from the specified resource (if any), give the
* name provided and add it as the first source.
*
* @param resource the source resource (may be {@code null}).
* @param name the root property name (may be {@code null}).
* @param profile a specific profile to load or {@code null} to load the default.
...
...
@@ -96,7 +94,7 @@ public class PropertySourcesLoader {
*/
public
PropertySource
<?>
load
(
Resource
resource
,
String
name
,
String
profile
)
throws
IOException
{
return
this
.
load
(
resource
,
null
,
name
,
profile
);
return
load
(
resource
,
null
,
name
,
profile
);
}
/**
...
...
@@ -108,7 +106,6 @@ public class PropertySourcesLoader {
* groups afterwards (with the highest priority last). Property resolution from the
* resulting sources will consider all keys for a given group first and then move to
* the next group.
*
* @param resource the source resource (may be {@code null}).
* @param group an identifier for the group that this source belongs to
* @param name the root property name (may be {@code null}).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment