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
74677629
Commit
74677629
authored
Nov 01, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove handling of spring.git.properties
Closes gh-10857
parent
8fe49eb9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
44 deletions
+19
-44
additional-spring-configuration-metadata.json
...es/META-INF/additional-spring-configuration-metadata.json
+0
-8
ProjectInfoAutoConfiguration.java
...boot/autoconfigure/info/ProjectInfoAutoConfiguration.java
+1
-2
ProjectInfoProperties.java
...mework/boot/autoconfigure/info/ProjectInfoProperties.java
+1
-13
additional-spring-configuration-metadata.json
...es/META-INF/additional-spring-configuration-metadata.json
+17
-0
ProjectInfoAutoConfigurationTests.java
...autoconfigure/info/ProjectInfoAutoConfigurationTests.java
+0
-21
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
View file @
74677629
...
...
@@ -190,14 +190,6 @@
"description"
:
"Instrument all available data sources."
,
"defaultValue"
:
true
},
{
"name"
:
"spring.git.properties"
,
"type"
:
"java.lang.String"
,
"description"
:
"Resource reference to a generated git info properties file."
,
"deprecation"
:
{
"replacement"
:
"spring.info.git.location"
}
},
{
"name"
:
"endpoints.actuator.enabled"
,
"type"
:
"java.lang.Boolean"
,
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfiguration.java
View file @
74677629
...
...
@@ -95,8 +95,7 @@ public class ProjectInfoAutoConfiguration {
Environment
environment
=
context
.
getEnvironment
();
String
location
=
environment
.
getProperty
(
"spring.info.git.location"
);
if
(
location
==
null
)
{
location
=
environment
.
getProperty
(
"spring.git.properties"
);
location
=
(
location
!=
null
?
location
:
"classpath:git.properties"
);
location
=
"classpath:git.properties"
;
}
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
"GitResource"
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/info/ProjectInfoProperties.java
View file @
74677629
...
...
@@ -16,8 +16,6 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
info
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.Resource
;
...
...
@@ -43,16 +41,6 @@ public class ProjectInfoProperties {
return
this
.
git
;
}
/**
* Make sure that the "spring.git.properties" legacy key is used by default.
* @param defaultGitLocation the default git location to use
*/
@Autowired
void
setDefaultGitLocation
(
@Value
(
"${spring.git.properties:classpath:git.properties}"
)
Resource
defaultGitLocation
)
{
getGit
().
setLocation
(
defaultGitLocation
);
}
/**
* Build specific info properties.
*/
...
...
@@ -82,7 +70,7 @@ public class ProjectInfoProperties {
/**
* Location of the generated git.properties file.
*/
private
Resource
location
;
private
Resource
location
=
new
ClassPathResource
(
"git.properties"
)
;
public
Resource
getLocation
()
{
return
this
.
location
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
View file @
74677629
...
...
@@ -177,6 +177,14 @@
"http://localhost:9200"
]
},
{
"name"
:
"spring.info.build.location"
,
"defaultValue"
:
"classpath:META-INF/build-info.properties"
},
{
"name"
:
"spring.info.git.location"
,
"defaultValue"
:
"classpath:git.properties"
},
{
"name"
:
"spring.freemarker.prefix"
,
"defaultValue"
:
""
...
...
@@ -1039,6 +1047,15 @@
"level"
:
"error"
}
},
{
"name"
:
"spring.git.properties"
,
"type"
:
"java.lang.String"
,
"description"
:
"Resource reference to a generated git info properties file."
,
"deprecation"
:
{
"replacement"
:
"spring.info.git.location"
,
"level"
:
"error"
}
},
{
"name"
:
"spring.http.multipart.enabled"
,
"type"
:
"java.lang.Boolean"
,
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/info/ProjectInfoAutoConfigurationTests.java
View file @
74677629
...
...
@@ -56,27 +56,6 @@ public class ProjectInfoAutoConfigurationTests {
assertThat
(
beans
).
hasSize
(
0
);
}
@Test
public
void
gitLocationTakesPrecedenceOverLegacyKey
()
{
load
(
"spring.info.git.location=classpath:/org/springframework/boot/autoconfigure/info/git.properties"
,
"spring.git.properties=classpath:/org/springframework/boot/autoconfigure/info/git-no-data.properties"
);
GitProperties
gitProperties
=
this
.
context
.
getBean
(
GitProperties
.
class
);
assertThat
(
gitProperties
.
getBranch
()).
isNull
();
assertThat
(
gitProperties
.
getCommitId
())
.
isEqualTo
(
"f95038ec09e29d8f91982fd1cbcc0f3b131b1d0a"
);
assertThat
(
gitProperties
.
getCommitTime
().
getTime
()).
isEqualTo
(
1456995720000L
);
}
@Test
public
void
gitLegacyKeyIsUsedAsFallback
()
{
load
(
"spring.git.properties=classpath:/org/springframework/boot/autoconfigure/info/git-epoch.properties"
);
GitProperties
gitProperties
=
this
.
context
.
getBean
(
GitProperties
.
class
);
assertThat
(
gitProperties
.
getBranch
()).
isEqualTo
(
"master"
);
assertThat
(
gitProperties
.
getCommitId
())
.
isEqualTo
(
"5009933788f5f8c687719de6a697074ff80b1b69"
);
assertThat
(
gitProperties
.
getCommitTime
().
getTime
()).
isEqualTo
(
1457103850000L
);
}
@Test
public
void
gitPropertiesWithNoData
()
{
load
(
"spring.info.git.location=classpath:/org/springframework/boot/autoconfigure/info/git-no-data.properties"
);
...
...
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