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
0f321abe
Commit
0f321abe
authored
Jun 04, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.0.x'
parents
aee6aecf
70c0d6a0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
3 deletions
+24
-3
reacting.adoc
...spring-boot-gradle-plugin/src/main/asciidoc/reacting.adoc
+4
-2
ApplicationPluginAction.java
...framework/boot/gradle/plugin/ApplicationPluginAction.java
+2
-0
GradleCompatibilitySuite.java
...framework/boot/gradle/junit/GradleCompatibilitySuite.java
+1
-1
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 @
0f321abe
...
@@ -70,8 +70,10 @@ applied to a project, the Spring Boot plugin will automatically import the
...
@@ -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
When Gradle's {application-plugin}[`application` plugin] is applied to a project, the
Spring Boot plugin:
Spring Boot plugin:
1. Creates a `CreateStartScripts` task named `bootStartScripts` that will creates scripts
1. Creates a `CreateStartScripts` task named `bootStartScripts` that will create scripts
that launch the artifact in the `bootArchives` configuration using `java -jar`.
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
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
the `bootArchives` configuration in its `lib` directory and the start scripts in its
`bin` directory.
`bin` directory.
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/ApplicationPluginAction.java
View file @
0f321abe
...
@@ -77,6 +77,8 @@ final class ApplicationPluginAction implements PluginApplicationAction {
...
@@ -77,6 +77,8 @@ final class ApplicationPluginAction implements PluginApplicationAction {
()
->
new
File
(
project
.
getBuildDir
(),
"bootScripts"
));
()
->
new
File
(
project
.
getBuildDir
(),
"bootScripts"
));
bootStartScripts
.
getConventionMapping
().
map
(
"applicationName"
,
bootStartScripts
.
getConventionMapping
().
map
(
"applicationName"
,
applicationConvention:
:
getApplicationName
);
applicationConvention:
:
getApplicationName
);
bootStartScripts
.
getConventionMapping
().
map
(
"defaultJvmOpts"
,
applicationConvention:
:
getApplicationDefaultJvmArgs
);
CopySpec
binCopySpec
=
project
.
copySpec
().
into
(
"bin"
).
from
(
bootStartScripts
);
CopySpec
binCopySpec
=
project
.
copySpec
().
into
(
"bin"
).
from
(
bootStartScripts
);
binCopySpec
.
setFileMode
(
0x755
);
binCopySpec
.
setFileMode
(
0x755
);
distribution
.
getContents
().
with
(
binCopySpec
);
distribution
.
getContents
().
with
(
binCopySpec
);
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java
View file @
0f321abe
...
@@ -39,7 +39,7 @@ import org.springframework.boot.gradle.testkit.GradleBuild;
...
@@ -39,7 +39,7 @@ import org.springframework.boot.gradle.testkit.GradleBuild;
public
final
class
GradleCompatibilitySuite
extends
Suite
{
public
final
class
GradleCompatibilitySuite
extends
Suite
{
private
static
final
List
<
String
>
GRADLE_VERSIONS
=
Arrays
.
asList
(
"default"
,
"4.1"
,
private
static
final
List
<
String
>
GRADLE_VERSIONS
=
Arrays
.
asList
(
"default"
,
"4.1"
,
"4.2"
,
"4.3"
,
"4.4.1"
,
"4.5.1"
,
"4.6"
,
"4.7"
);
"4.2"
,
"4.3"
,
"4.4.1"
,
"4.5.1"
,
"4.6"
,
"4.7"
,
"4.8"
);
public
GradleCompatibilitySuite
(
Class
<?>
clazz
)
throws
InitializationError
{
public
GradleCompatibilitySuite
(
Class
<?>
clazz
)
throws
InitializationError
{
super
(
clazz
,
createRunners
(
clazz
));
super
(
clazz
,
createRunners
(
clazz
));
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.java
View file @
0f321abe
...
@@ -73,6 +73,14 @@ public class ApplicationPluginActionIntegrationTests {
...
@@ -73,6 +73,14 @@ public class ApplicationPluginActionIntegrationTests {
.
contains
(
"bootStartScripts exists = true"
);
.
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
@Test
public
void
zipDistributionForJarCanBeBuilt
()
throws
IOException
{
public
void
zipDistributionForJarCanBeBuilt
()
throws
IOException
{
assertThat
(
assertThat
(
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.gradle
View file @
0f321abe
...
@@ -8,6 +8,7 @@ apply plugin: 'org.springframework.boot'
...
@@ -8,6 +8,7 @@ apply plugin: 'org.springframework.boot'
if
(
project
.
hasProperty
(
'applyApplicationPlugin'
))
{
if
(
project
.
hasProperty
(
'applyApplicationPlugin'
))
{
apply
plugin:
'application'
apply
plugin:
'application'
applicationDefaultJvmArgs
=
[
'-Dcom.example.a=alpha'
,
'-Dcom.example.b=bravo'
]
}
}
task
(
'taskExists'
)
{
task
(
'taskExists'
)
{
...
@@ -31,3 +32,11 @@ task('javaCompileEncoding') {
...
@@ -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