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.

Comment From: varshaj

I would like to take a stab at it

Comment From: mbhave

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

Comment From: snicoll

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

Comment From: varshaj

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

Regards, Varsha

Comment From: snicoll

No problem @varshaj and thanks for letting us know.

Comment From: omlip

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

Comment From: snicoll

Alright, the issue is all yours Olivier.

Comment From: sumanth712bs

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

Comment From: marcusdacoregio

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

Comment From: snicoll

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

Comment From: omlip

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

Let me know if it missing something

Comment From: snicoll

Closing in favour of PR #23753