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
00449bef
Commit
00449bef
authored
Jun 04, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use app…DefaultJvmArgs as convention for start script's defaultJvmOpts
Closes gh-12631
parent
624946a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
2 deletions
+23
-2
reacting.adoc
...spring-boot-gradle-plugin/src/main/asciidoc/reacting.adoc
+4
-2
ApplicationPluginAction.java
...framework/boot/gradle/plugin/ApplicationPluginAction.java
+2
-0
ApplicationPluginActionIntegrationTests.java
...radle/plugin/ApplicationPluginActionIntegrationTests.java
+8
-0
ApplicationPluginActionIntegrationTests.gradle
...dle/plugin/ApplicationPluginActionIntegrationTests.gradle
+9
-0
No files found.
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/reacting.adoc
View file @
00449bef
...
...
@@ -70,8 +70,10 @@ applied to a project, the Spring Boot plugin will automatically import the
When Gradle's {application-plugin}[`application` plugin] is applied to a project, the
Spring Boot plugin:
1. Creates a `CreateStartScripts` task named `bootStartScripts` that will creates scripts
that launch the artifact in the `bootArchives` configuration using `java -jar`.
1. Creates a `CreateStartScripts` task named `bootStartScripts` that will create scripts
that launch the artifact in the `bootArchives` configuration using `java -jar`. The
task is configured to use the `applicationDefaultJvmArgs` property as a convention
for its `defaultJvmOpts` property.
2. Creates a new distribution named `boot` and configures it to contain the artifact in
the `bootArchives` configuration in its `lib` directory and the start scripts in its
`bin` directory.
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java
View file @
00449bef
...
...
@@ -77,6 +77,8 @@ final class ApplicationPluginAction implements PluginApplicationAction {
()
->
new
File
(
project
.
getBuildDir
(),
"bootScripts"
));
bootStartScripts
.
getConventionMapping
().
map
(
"applicationName"
,
applicationConvention:
:
getApplicationName
);
bootStartScripts
.
getConventionMapping
().
map
(
"defaultJvmOpts"
,
applicationConvention:
:
getApplicationDefaultJvmArgs
);
CopySpec
binCopySpec
=
project
.
copySpec
().
into
(
"bin"
).
from
(
bootStartScripts
);
binCopySpec
.
setFileMode
(
0x755
);
distribution
.
getContents
().
with
(
binCopySpec
);
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.java
View file @
00449bef
...
...
@@ -73,6 +73,14 @@ public class ApplicationPluginActionIntegrationTests {
.
contains
(
"bootStartScripts exists = true"
);
}
@Test
public
void
createsBootStartScriptsTaskUsesApplicationPluginsDefaultJvmOpts
()
{
assertThat
(
this
.
gradleBuild
.
build
(
"startScriptsDefaultJvmOpts"
,
"-PapplyApplicationPlugin"
)
.
getOutput
()).
contains
(
"bootStartScripts defaultJvmOpts = [-Dcom.example.a=alpha, -Dcom.example.b=bravo]"
);
}
@Test
public
void
zipDistributionForJarCanBeBuilt
()
throws
IOException
{
assertThat
(
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.gradle
View file @
00449bef
...
...
@@ -8,6 +8,7 @@ apply plugin: 'org.springframework.boot'
if
(
project
.
hasProperty
(
'applyApplicationPlugin'
))
{
apply
plugin:
'application'
applicationDefaultJvmArgs
=
[
'-Dcom.example.a=alpha'
,
'-Dcom.example.b=bravo'
]
}
task
(
'taskExists'
)
{
...
...
@@ -31,3 +32,11 @@ task('javaCompileEncoding') {
}
}
}
task
(
'startScriptsDefaultJvmOpts'
)
{
doFirst
{
tasks
.
withType
(
org
.
springframework
.
boot
.
gradle
.
tasks
.
application
.
CreateBootStartScripts
)
{
println
"$name defaultJvmOpts = $defaultJvmOpts"
}
}
}
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