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
51e6eda8
Commit
51e6eda8
authored
May 27, 2015
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update documentation for spring.main.sources
Closes gh-2851
parent
97cf8680
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+1
-1
howto.adoc
spring-boot-docs/src/main/asciidoc/howto.adoc
+24
-0
additional-spring-configuration-metadata.json
...es/META-INF/additional-spring-configuration-metadata.json
+1
-1
No files found.
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
51e6eda8
...
...
@@ -40,7 +40,7 @@ content into your application; rather pick only the properties that you need.
spring.profiles.include= # unconditionally activate the specified comma separated profiles
# APPLICATION SETTINGS ({sc-spring-boot}/SpringApplication.{sc-ext}[SpringApplication])
spring.main.sources=
spring.main.sources=
# sources (class name, package name or XML resource location) to include
spring.main.web-environment= # detect by default
spring.main.show-banner=true
spring.main....= # see class for all properties
...
...
spring-boot-docs/src/main/asciidoc/howto.adoc
View file @
51e6eda8
...
...
@@ -132,6 +132,30 @@ not be a web application.
NOTE: The example above also demonstrates how flexible binding allows the use of
underscores (`_`) as well as dashes (`-`) in property names.
Properties defined in external configuration overrides the values specified via the Java
API with the notable exception of the sources used to create the `ApplicationContext`. Let's
consider this application
[source,java,indent=0]
----
new SpringApplicationBuilder()
.showBanner(false)
.sources(demo.MyApp.class)
.run(args);
----
used with the following configuration:
[source,properties,indent=0,subs="verbatim,quotes,attributes"]
----
spring.main.sources=com.acme.Config,com.acme.ExtraConfig
spring.main.show-banner=true
----
The actual application will _not_ show the banner and use three sources for the
`ApplicationContext` (in that order): `demo.MyApp`, `com.acme.Config`,
`com.acme.ExtraConfig`.
[[howto-change-the-location-of-external-properties]]
=== Change the location of external properties of an application
By default properties from different sources are added to the Spring `Environment` in a
...
...
spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
View file @
51e6eda8
...
...
@@ -89,7 +89,7 @@
"name"
:
"spring.main.sources"
,
"type"
:
"java.util.Set<java.lang.Object>"
,
"sourceType"
:
"org.springframework.boot.SpringApplication"
,
"description"
:
"Sources (class name, package name or XML resource location)
used to create
the ApplicationContext."
"description"
:
"Sources (class name, package name or XML resource location)
to include in
the ApplicationContext."
},
{
"name"
:
"spring.main.web-environment"
,
...
...
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