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
c2a483a7
Commit
c2a483a7
authored
Oct 15, 2020
by
Kedar Joshi
Committed by
Stephane Nicoll
Oct 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow overriding image.cleanCache from the command-line
See gh-32719
parent
771503f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
4 deletions
+21
-4
packaging-oci-image.adoc
...t-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc
+1
-1
BuildImageMojo.java
...n/java/org/springframework/boot/maven/BuildImageMojo.java
+11
-0
Image.java
...n/src/main/java/org/springframework/boot/maven/Image.java
+9
-3
No files found.
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc
View file @
c2a483a7
...
@@ -153,7 +153,7 @@ Acceptable values are `ALWAYS`, `NEVER`, and `IF_NOT_PRESENT`.
...
@@ -153,7 +153,7 @@ Acceptable values are `ALWAYS`, `NEVER`, and `IF_NOT_PRESENT`.
| `cleanCache`
| `cleanCache`
| Whether to clean the cache before building.
| Whether to clean the cache before building.
|
|
`spring-boot.build-image.cleanCache`
| `false`
| `false`
| `verboseLogging`
| `verboseLogging`
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildImageMojo.java
View file @
c2a483a7
...
@@ -130,6 +130,14 @@ public class BuildImageMojo extends AbstractPackagerMojo {
...
@@ -130,6 +130,14 @@ public class BuildImageMojo extends AbstractPackagerMojo {
@Parameter
(
property
=
"spring-boot.build-image.runImage"
,
readonly
=
true
)
@Parameter
(
property
=
"spring-boot.build-image.runImage"
,
readonly
=
true
)
String
runImage
;
String
runImage
;
/**
* Alias for {@link Image#cleanCache} to support configuration via command-line
* property.
* @since 2.4.0
*/
@Parameter
(
property
=
"spring-boot.build-image.cleanCache"
,
readonly
=
true
)
Boolean
cleanCache
;
/**
/**
* Alias for {@link Image#pullPolicy} to support configuration via command-line
* Alias for {@link Image#pullPolicy} to support configuration via command-line
* property.
* property.
...
@@ -189,6 +197,9 @@ public class BuildImageMojo extends AbstractPackagerMojo {
...
@@ -189,6 +197,9 @@ public class BuildImageMojo extends AbstractPackagerMojo {
if
(
image
.
runImage
==
null
&&
this
.
runImage
!=
null
)
{
if
(
image
.
runImage
==
null
&&
this
.
runImage
!=
null
)
{
image
.
setRunImage
(
this
.
runImage
);
image
.
setRunImage
(
this
.
runImage
);
}
}
if
(
image
.
cleanCache
==
null
&&
this
.
cleanCache
!=
null
)
{
image
.
setCleanCache
(
this
.
cleanCache
);
}
if
(
image
.
pullPolicy
==
null
&&
this
.
pullPolicy
!=
null
)
{
if
(
image
.
pullPolicy
==
null
&&
this
.
pullPolicy
!=
null
)
{
image
.
setPullPolicy
(
this
.
pullPolicy
);
image
.
setPullPolicy
(
this
.
pullPolicy
);
}
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/Image.java
View file @
c2a483a7
...
@@ -46,7 +46,7 @@ public class Image {
...
@@ -46,7 +46,7 @@ public class Image {
Map
<
String
,
String
>
env
;
Map
<
String
,
String
>
env
;
b
oolean
cleanCache
;
B
oolean
cleanCache
;
boolean
verboseLogging
;
boolean
verboseLogging
;
...
@@ -102,10 +102,14 @@ public class Image {
...
@@ -102,10 +102,14 @@ public class Image {
* If the cache should be cleaned before building.
* If the cache should be cleaned before building.
* @return {@code true} if the cache should be cleaned
* @return {@code true} if the cache should be cleaned
*/
*/
public
b
oolean
isCleanCache
()
{
public
B
oolean
isCleanCache
()
{
return
this
.
cleanCache
;
return
this
.
cleanCache
;
}
}
void
setCleanCache
(
Boolean
cleanCache
)
{
this
.
cleanCache
=
cleanCache
;
}
/**
/**
* If verbose logging is required.
* If verbose logging is required.
* @return {@code true} for verbose logging
* @return {@code true} for verbose logging
...
@@ -160,7 +164,9 @@ public class Image {
...
@@ -160,7 +164,9 @@ public class Image {
if
(
this
.
env
!=
null
&&
!
this
.
env
.
isEmpty
())
{
if
(
this
.
env
!=
null
&&
!
this
.
env
.
isEmpty
())
{
request
=
request
.
withEnv
(
this
.
env
);
request
=
request
.
withEnv
(
this
.
env
);
}
}
request
=
request
.
withCleanCache
(
this
.
cleanCache
);
if
(
this
.
cleanCache
!=
null
)
{
request
=
request
.
withCleanCache
(
this
.
cleanCache
);
}
request
=
request
.
withVerboseLogging
(
this
.
verboseLogging
);
request
=
request
.
withVerboseLogging
(
this
.
verboseLogging
);
if
(
this
.
pullPolicy
!=
null
)
{
if
(
this
.
pullPolicy
!=
null
)
{
request
=
request
.
withPullPolicy
(
this
.
pullPolicy
);
request
=
request
.
withPullPolicy
(
this
.
pullPolicy
);
...
...
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