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
3abd8d3a
Commit
3abd8d3a
authored
May 04, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop support for configuring PropertiesLauncher with application.properties
Closes gh-8464
parent
525f4214
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
26 deletions
+6
-26
appendix-executable-jar-format.adoc
...ocs/src/main/asciidoc/appendix-executable-jar-format.adoc
+0
-6
PropertiesLauncher.java
...a/org/springframework/boot/loader/PropertiesLauncher.java
+6
-20
No files found.
spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc
View file @
3abd8d3a
...
...
@@ -201,12 +201,6 @@ the appropriate launcher:
properties (System properties, environment variables, manifest entries or
`loader.properties`).
NOTE: `PropertiesLauncher` supports loading properties from
`loader.properties` and also (for historic reasons)
`application.properties`. We recommend using
`loader.properties` exclusively, as support for
`application.properties` is deprecated and may be removed in the future.
|===
|Key |Purpose
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java
View file @
3abd8d3a
...
...
@@ -46,10 +46,10 @@ import org.springframework.boot.loader.util.SystemPropertyUtils;
* well-behaved OS-level services than a model based on executable jars.
* <p>
* Looks in various places for a properties file to extract loader settings, defaulting to
* {@code
application.properties} either on the current classpath or in the current
*
working directory. The name of the properties file can be changed by setting a System
*
property {@code loader.config.name} (e.g. {@code -Dloader.config.name=foo} will look
*
for
{@code foo.properties}. If that file doesn't exist then tries
* {@code
loader.properties} either on the current classpath or in the current working
*
directory. The name of the properties file can be changed by setting a System property
*
{@code loader.config.name} (e.g. {@code -Dloader.config.name=foo} will look for
* {@code foo.properties}. If that file doesn't exist then tries
* {@code loader.config.location} (with allowed prefixes {@code classpath:} and
* {@code file:} or any valid URL). Once that file is located turns it into Properties and
* extracts optional values (which can also be provided overridden as System properties in
...
...
@@ -156,8 +156,7 @@ public class PropertiesLauncher extends Launcher {
configs
.
add
(
getProperty
(
CONFIG_LOCATION
));
}
else
{
String
[]
names
=
getPropertyWithDefault
(
CONFIG_NAME
,
"loader,application"
)
.
split
(
","
);
String
[]
names
=
getPropertyWithDefault
(
CONFIG_NAME
,
"loader"
).
split
(
","
);
for
(
String
name
:
names
)
{
configs
.
add
(
"file:"
+
getHomeDirectory
()
+
"/"
+
name
+
".properties"
);
configs
.
add
(
"classpath:"
+
name
+
".properties"
);
...
...
@@ -175,10 +174,6 @@ public class PropertiesLauncher extends Launcher {
resource
.
close
();
}
for
(
Object
key
:
Collections
.
list
(
this
.
properties
.
propertyNames
()))
{
if
(
config
.
endsWith
(
"application.properties"
)
&&
((
String
)
key
).
startsWith
(
"loader."
))
{
warn
(
"Use of application.properties for PropertiesLauncher is deprecated"
);
}
String
text
=
this
.
properties
.
getProperty
((
String
)
key
);
String
value
=
SystemPropertyUtils
.
resolvePlaceholders
(
this
.
properties
,
text
);
...
...
@@ -608,19 +603,10 @@ public class PropertiesLauncher extends Launcher {
private
void
debug
(
String
message
)
{
if
(
Boolean
.
getBoolean
(
DEBUG
))
{
log
(
message
);
System
.
out
.
println
(
message
);
}
}
private
void
warn
(
String
message
)
{
log
(
"WARNING: "
+
message
);
}
private
void
log
(
String
message
)
{
// We shouldn't use java.util.logging because of classpath issues
System
.
out
.
println
(
message
);
}
/**
* Convenience class for finding nested archives that have a prefix in their file path
* (e.g. "lib/").
...
...
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