Use app…DefaultJvmArgs as convention for start script's defaultJvmOpts
Closes gh-12631
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user