Spring-boot: Expose BootBuildImage's cleanCache property as a command-line option

Created on 7 Sep 2020  路  12Comments  路  Source: spring-projects/spring-boot

Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

If you have contributed before, consider leaving this one for someone new, and looking through our general ideal-for-contribution issues. Thanks!

Problem

When building an image using Cloud Native Buildpacks and the Gradle Plugin, there is an option to clear the image's associated cache before building.
This option is not available as a command-line option.

Solution

To mark a property of a Task as being configurable from the command-line, it should be annotated with @Option. See the Gradle User Guide for more details.
The property is defined in org.springframework.boot.gradle.tasks.bundling.BootBuildImage.

Adding the following should expose the property as a command-line argument:

@Option(option = "cleanCache", description = "Clean caches before packaging")
public void setCleanCache(boolean cleanCache) {
  this.cleanCache = cleanCache;
}

Steps to Fix

  • [x] Claim this issue with a comment below and ask any clarifying questions you need
  • [ ] Set up a repository locally following the Contributing Guidelines
  • [ ] Try to fix the issue following the steps above
  • [ ] Commit your changes and start a pull request.
first-timers-only superseded enhancement

Most helpful comment

Thanks both. Let's wait from @omlip first please.

All 12 comments

I would like to take a stab at it

@varshaj Sure! Let me know if you have any questions.

@varshaj how is it going? If you don't have time to look at this anymore, please let us know.

I am afraid that will be the case. I d like to contribute but got busy in
my project.

Regards,
Varsha

No problem @varshaj and thanks for letting us know.

Hi @snicoll ,
I would like to help :-)

Alright, the issue is all yours Olivier.

I would be happy to help if its not resolved :)

I would like to work on it if anyone hasn't done it yet 馃槈

Thanks both. Let's wait from @omlip first please.

PR submitted https://github.com/spring-projects/spring-boot/pull/23753

Let me know if it missing something

Closing in favour of PR #23753

Was this page helpful?
0 / 5 - 0 ratings