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
4cdb5a8e
Commit
4cdb5a8e
authored
May 25, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Default to optimized launch of the JVM when using spring-boot:run"
Closes gh-16941
parent
569b850f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
+20
-7
invoker.properties
...ring-boot-maven-plugin/src/it/run-fork/invoker.properties
+1
-0
verify.groovy
...ls/spring-boot-maven-plugin/src/it/run-fork/verify.groovy
+4
-1
RunMojo.java
...src/main/java/org/springframework/boot/maven/RunMojo.java
+15
-6
No files found.
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/invoker.properties
0 → 100644
View file @
4cdb5a8e
invoker.goals
=
clean verify -X
\ No newline at end of file
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/verify.groovy
View file @
4cdb5a8e
import
static
org
.
junit
.
Assert
.
assertTrue
def
file
=
new
File
(
basedir
,
"build.log"
)
def
file
=
new
File
(
basedir
,
"build.log"
)
return
file
.
text
.
contains
(
"I haz been run from '$basedir'"
)
assertTrue
file
.
text
.
contains
(
"I haz been run from '$basedir'"
)
assertTrue
file
.
text
.
contains
(
"JVM argument(s): -Xverify:none -XX:TieredStopAtLevel=1"
)
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java
View file @
4cdb5a8e
...
@@ -19,7 +19,6 @@ package org.springframework.boot.maven;
...
@@ -19,7 +19,6 @@ package org.springframework.boot.maven;
import
java.io.File
;
import
java.io.File
;
import
java.net.URL
;
import
java.net.URL
;
import
java.net.URLClassLoader
;
import
java.net.URLClassLoader
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -55,8 +54,12 @@ public class RunMojo extends AbstractRunMojo {
...
@@ -55,8 +54,12 @@ public class RunMojo extends AbstractRunMojo {
*/
*/
private
Boolean
hasDevtools
;
private
Boolean
hasDevtools
;
/**
* Whether the JVM's launch should be optimized.
* @since 2.2.0
*/
@Parameter
(
property
=
"optimizedLaunch"
,
defaultValue
=
"true"
)
@Parameter
(
property
=
"optimizedLaunch"
,
defaultValue
=
"true"
)
private
boolean
optimizedLaunch
=
true
;
private
boolean
optimizedLaunch
;
@Override
@Override
@Deprecated
@Deprecated
...
@@ -72,13 +75,19 @@ public class RunMojo extends AbstractRunMojo {
...
@@ -72,13 +75,19 @@ public class RunMojo extends AbstractRunMojo {
}
}
}
}
@Override
protected
RunArguments
resolveJvmArguments
()
{
RunArguments
jvmArguments
=
super
.
resolveJvmArguments
();
if
(
isFork
()
&&
this
.
optimizedLaunch
)
{
jvmArguments
.
getArgs
().
addFirst
(
"-XX:TieredStopAtLevel=1"
);
jvmArguments
.
getArgs
().
addFirst
(
"-Xverify:none"
);
}
return
jvmArguments
;
}
@Override
@Override
protected
void
runWithForkedJvm
(
File
workingDirectory
,
List
<
String
>
args
,
protected
void
runWithForkedJvm
(
File
workingDirectory
,
List
<
String
>
args
,
Map
<
String
,
String
>
environmentVariables
)
throws
MojoExecutionException
{
Map
<
String
,
String
>
environmentVariables
)
throws
MojoExecutionException
{
if
(
this
.
optimizedLaunch
)
{
String
[]
optimizedLaunchArgs
=
{
"-Xverify:none"
,
"-XX:TieredStopAtLevel=1"
};
Collections
.
addAll
(
args
,
optimizedLaunchArgs
);
}
int
exitCode
=
forkJvm
(
workingDirectory
,
args
,
environmentVariables
);
int
exitCode
=
forkJvm
(
workingDirectory
,
args
,
environmentVariables
);
if
(
exitCode
==
0
||
exitCode
==
EXIT_CODE_SIGINT
)
{
if
(
exitCode
==
0
||
exitCode
==
EXIT_CODE_SIGINT
)
{
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