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
e088ecd1
Commit
e088ecd1
authored
Jun 20, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-order shutdown hook in BootRunTask
parent
b5d65bfc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
BootRunTask.java
...oovy/org/springframework/boot/gradle/run/BootRunTask.java
+20
-16
No files found.
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/BootRunTask.java
View file @
e088ecd1
...
@@ -30,7 +30,6 @@ import org.gradle.process.ExecResult;
...
@@ -30,7 +30,6 @@ import org.gradle.process.ExecResult;
import
org.gradle.process.internal.DefaultJavaExecAction
;
import
org.gradle.process.internal.DefaultJavaExecAction
;
import
org.gradle.process.internal.ExecHandle
;
import
org.gradle.process.internal.ExecHandle
;
import
org.springframework.boot.loader.tools.FileUtils
;
import
org.springframework.boot.loader.tools.FileUtils
;
import
org.springframework.boot.loader.tools.SignalUtils
;
import
org.springframework.util.ReflectionUtils
;
import
org.springframework.util.ReflectionUtils
;
/**
/**
...
@@ -73,17 +72,22 @@ public class BootRunTask extends JavaExec {
...
@@ -73,17 +72,22 @@ public class BootRunTask extends JavaExec {
DefaultJavaExecAction
action
=
(
DefaultJavaExecAction
)
builder
.
get
(
this
);
DefaultJavaExecAction
action
=
(
DefaultJavaExecAction
)
builder
.
get
(
this
);
setMain
(
getMain
());
setMain
(
getMain
());
final
ExecHandle
execHandle
=
action
.
build
();
final
ExecHandle
execHandle
=
action
.
build
();
ExecResult
execResult
=
execHandle
.
start
().
waitForFinish
();
try
{
if
(!
isIgnoreExitValue
())
{
Runtime
.
getRuntime
().
addShutdownHook
(
new
Thread
(
new
Runnable
()
{
execResult
.
assertNormalExitValue
();
}
SignalUtils
.
attachSignalHandler
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
getLogger
().
info
(
"Aborting java sub-process"
);
getLogger
().
info
(
"Aborting java sub-process"
);
execHandle
.
abort
();
execHandle
.
abort
();
}
}
});
}));
}
catch
(
Exception
e
)
{
getLogger
().
warn
(
"Could not attach shutdown hook (child process may be orphaned)"
);
}
ExecResult
execResult
=
execHandle
.
start
().
waitForFinish
();
if
(!
isIgnoreExitValue
())
{
execResult
.
assertNormalExitValue
();
}
return
execResult
;
return
execResult
;
}
}
...
...
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