spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.43k stars 40.76k forks source link

Expose BootBuildImage's cleanCache property as a command-line option #23206

Closed wilkinsona closed 4 years ago

wilkinsona commented 4 years ago

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

varshaj commented 4 years ago

I would like to take a stab at it

mbhave commented 4 years ago

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

snicoll commented 4 years ago

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

varshaj commented 4 years ago

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

Regards, Varsha

snicoll commented 4 years ago

No problem @varshaj and thanks for letting us know.

omlip commented 4 years ago

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

snicoll commented 4 years ago

Alright, the issue is all yours Olivier.

sumanth712bs commented 4 years ago

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

marcusdacoregio commented 4 years ago

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

snicoll commented 4 years ago

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

omlip commented 4 years ago

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

Let me know if it missing something

snicoll commented 4 years ago

Closing in favour of PR #23753