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
fff91938
Commit
fff91938
authored
Aug 12, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.3.x'
Closes gh-22917
parents
bc3f028a
f43a0b48
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
15 deletions
+51
-15
build.gradle
.../spring-boot-tools/spring-boot-gradle-plugin/build.gradle
+1
-0
boot-build-image-env-proxy.gradle
...c/docs/gradle/packaging/boot-build-image-env-proxy.gradle
+6
-0
boot-build-image-env-proxy.gradle.kts
...cs/gradle/packaging/boot-build-image-env-proxy.gradle.kts
+11
-9
boot-build-image-env.gradle
...gin/src/docs/gradle/packaging/boot-build-image-env.gradle
+6
-0
boot-build-image-env.gradle.kts
...src/docs/gradle/packaging/boot-build-image-env.gradle.kts
+11
-6
PackagingDocumentationTests.java
...amework/boot/gradle/docs/PackagingDocumentationTests.java
+16
-0
No files found.
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle
View file @
fff91938
...
...
@@ -72,6 +72,7 @@ task dependencyVersions(type: org.springframework.boot.build.constraints.Extract
tasks
.
withType
(
org
.
asciidoctor
.
gradle
.
jvm
.
AbstractAsciidoctorTask
)
{
dependsOn
dependencyVersions
inputs
.
dir
(
'src/docs/gradle'
).
withPathSensitivity
(
PathSensitivity
.
RELATIVE
)
doFirst
{
attributes
"dependency-management-plugin-version"
:
dependencyVersions
.
versionConstraints
[
"io.spring.gradle:dependency-management-plugin"
]
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle
View file @
fff91938
...
...
@@ -15,3 +15,9 @@ bootBuildImage {
]
}
// end::env[]
task
bootBuildImageEnvironment
{
doFirst
{
bootBuildImage
.
environment
.
each
{
name
,
value
->
println
"$name=$value"
}
}
}
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy.gradle.kts
View file @
fff91938
import
org.springframework.boot.gradle.tasks.bundling.Boot
Jar
import
org.springframework.boot.gradle.tasks.bundling.Boot
BuildImage
plugins
{
java
id
(
"org.springframework.boot"
)
version
"{gradle-project-version}"
}
tasks
.
getByName
<
BootJar
>(
"bootJar"
)
{
mainClassName
=
"com.example.ExampleApplication"
}
// tag::env[]
tasks
.
getByName
<
BootBuildImage
>(
"bootBuildImage"
)
{
environment
=
[
"HTTP_PROXY"
:
"http://proxy.example.com"
,
"HTTPS_PROXY"
:
"https://proxy.example.com"
]
environment
=
mapOf
(
"HTTP_PROXY"
to
"http://proxy.example.com"
,
"HTTPS_PROXY"
to
"https://proxy.example.com"
)
}
// end::env[]
tasks
.
register
(
"bootBuildImageEnvironment"
)
{
doFirst
{
for
((
name
,
value
)
in
tasks
.
getByName
<
BootBuildImage
>(
"bootBuildImage"
).
environment
)
{
print
(
name
+
"="
+
value
)
}
}
}
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle
View file @
fff91938
...
...
@@ -12,3 +12,9 @@ bootBuildImage {
environment
=
[
"BP_JVM_VERSION"
:
"13.0.1"
]
}
// end::env[]
task
bootBuildImageEnvironment
{
doFirst
{
bootBuildImage
.
environment
.
each
{
name
,
value
->
println
"$name=$value"
}
}
}
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env.gradle.kts
View file @
fff91938
import
org.springframework.boot.gradle.tasks.bundling.Boot
Jar
import
org.springframework.boot.gradle.tasks.bundling.Boot
BuildImage
plugins
{
java
id
(
"org.springframework.boot"
)
version
"{gradle-project-version}"
}
tasks
.
getByName
<
BootJar
>(
"bootJar"
)
{
mainClassName
=
"com.example.ExampleApplication"
}
// tag::env[]
tasks
.
getByName
<
BootBuildImage
>(
"bootBuildImage"
)
{
environment
=
[
"BP_JVM_VERSION"
:
"13.0.1"
]
environment
=
mapOf
(
"BP_JVM_VERSION"
to
"13.0.1"
)
}
// end::env[]
tasks
.
register
(
"bootBuildImageEnvironment"
)
{
doFirst
{
for
((
name
,
value
)
in
tasks
.
getByName
<
BootBuildImage
>(
"bootBuildImage"
).
environment
)
{
print
(
name
+
"="
+
value
)
}
}
}
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java
View file @
fff91938
...
...
@@ -28,6 +28,7 @@ import java.util.jar.JarOutputStream;
import
java.util.jar.Manifest
;
import
java.util.zip.ZipEntry
;
import
org.gradle.testkit.runner.BuildResult
;
import
org.junit.jupiter.api.TestTemplate
;
import
org.junit.jupiter.api.extension.ExtendWith
;
...
...
@@ -219,6 +220,21 @@ class PackagingDocumentationTests {
}
}
@TestTemplate
void
bootBuildImageWithCustomBuildpackJvmVersion
()
throws
IOException
{
BuildResult
result
=
this
.
gradleBuild
.
script
(
"src/docs/gradle/packaging/boot-build-image-env"
)
.
build
(
"bootBuildImageEnvironment"
);
assertThat
(
result
.
getOutput
()).
contains
(
"BP_JVM_VERSION=13.0.1"
);
}
@TestTemplate
void
bootBuildImageWithCustomProxySettings
()
throws
IOException
{
BuildResult
result
=
this
.
gradleBuild
.
script
(
"src/docs/gradle/packaging/boot-build-image-env-proxy"
)
.
build
(
"bootBuildImageEnvironment"
);
assertThat
(
result
.
getOutput
()).
contains
(
"HTTP_PROXY=http://proxy.example.com"
)
.
contains
(
"HTTPS_PROXY=https://proxy.example.com"
);
}
protected
void
jarFile
(
File
file
)
throws
IOException
{
try
(
JarOutputStream
jar
=
new
JarOutputStream
(
new
FileOutputStream
(
file
)))
{
jar
.
putNextEntry
(
new
ZipEntry
(
"META-INF/MANIFEST.MF"
));
...
...
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