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
d08d9849
Commit
d08d9849
authored
Mar 20, 2014
by
Christian Dupuis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Environment to shell context; disable shell banner if spring.main.show_banner is set to false
parent
99e6503a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
CrshAutoConfiguration.java
...ork/boot/actuate/autoconfigure/CrshAutoConfiguration.java
+7
-0
production-ready-features.adoc
...oot-docs/src/main/asciidoc/production-ready-features.adoc
+4
-1
login.groovy
...rter-shell/src/main/resources/commands/crash/login.groovy
+8
-0
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java
View file @
d08d9849
...
@@ -61,6 +61,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
...
@@ -61,6 +61,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.SpringVersion
;
import
org.springframework.core.SpringVersion
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.support.ResourcePatternResolver
;
import
org.springframework.core.io.support.ResourcePatternResolver
;
import
org.springframework.security.access.AccessDecisionManager
;
import
org.springframework.security.access.AccessDecisionManager
;
...
@@ -198,6 +199,9 @@ public class CrshAutoConfiguration {
...
@@ -198,6 +199,9 @@ public class CrshAutoConfiguration {
@Autowired
@Autowired
private
ListableBeanFactory
beanFactory
;
private
ListableBeanFactory
beanFactory
;
@Autowired
private
Environment
environment
;
@Autowired
@Autowired
private
ShellProperties
properties
;
private
ShellProperties
properties
;
...
@@ -250,6 +254,9 @@ public class CrshAutoConfiguration {
...
@@ -250,6 +254,9 @@ public class CrshAutoConfiguration {
if
(
this
.
beanFactory
!=
null
)
{
if
(
this
.
beanFactory
!=
null
)
{
attributes
.
put
(
"spring.beanfactory"
,
this
.
beanFactory
);
attributes
.
put
(
"spring.beanfactory"
,
this
.
beanFactory
);
}
}
if
(
this
.
environment
!=
null
)
{
attributes
.
put
(
"spring.environment"
,
this
.
environment
);
}
return
attributes
;
return
attributes
;
}
}
...
...
spring-boot-docs/src/main/asciidoc/production-ready-features.adoc
View file @
d08d9849
...
@@ -533,8 +533,11 @@ from your command:
...
@@ -533,8 +533,11 @@ from your command:
|`
spring
.
version
`
|`
spring
.
version
`
|
The
version
of
the
core
Spring
Framework
|
The
version
of
the
core
Spring
Framework
|`
spring
.
bean
F
actory
`
|`
spring
.
bean
f
actory
`
|
Access
to
the
Spring
`
BeanFactory
`
|
Access
to
the
Spring
`
BeanFactory
`
|`
spring
.
environment
`
|
Access
to
the
Spring
`
Environment
`
|===
|===
...
...
spring-boot-starters/spring-boot-starter-shell/src/main/resources/commands/crash/login.groovy
View file @
d08d9849
welcome
=
{
->
welcome
=
{
->
if
(!
crash
.
context
.
attributes
[
'spring.environment'
].
getProperty
(
"spring.main.show_banner"
,
Boolean
.
class
,
Boolean
.
TRUE
))
{
return
""
}
// Resolve hostname
def
hostName
;
def
hostName
;
try
{
try
{
hostName
=
java
.
net
.
InetAddress
.
getLocalHost
().
getHostName
();
hostName
=
java
.
net
.
InetAddress
.
getLocalHost
().
getHostName
();
}
catch
(
java
.
net
.
UnknownHostException
ignore
)
{
}
catch
(
java
.
net
.
UnknownHostException
ignore
)
{
hostName
=
"localhost"
;
hostName
=
"localhost"
;
}
}
// Get Spring Boot version from context
def
version
=
crash
.
context
.
attributes
.
get
(
"spring.boot.version"
)
def
version
=
crash
.
context
.
attributes
.
get
(
"spring.boot.version"
)
return
"""\
return
"""\
. ____ _ __ _ _
. ____ _ __ _ _
/\\\\ / ___'_ __ _ _(_)_ __ __ _ \\ \\ \\ \\
/\\\\ / ___'_ __ _ _(_)_ __ __ _ \\ \\ \\ \\
...
...
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