What we are trying to solve: We use another Gradle build plugin to build RPM package (which is not aware of any Spring gradle plugin) and it bundles all jar dependencies. It's using project.configurations.runtimeClasspath to select JAR files, but it also bundles dependencies marked as developmentOnly such as spring-boot-devtools. Such dependencies should not be bundled in production RPM package. We don't see any easy way how to handle this. I have no specific suggestion how to solve this, but it would be fine to have some option how to handle this situation.

Comment From: wilkinsona

The plugin creates a configuration named productionRuntimeClasspath that can be used for this purpose. Its name is available as a constant on SpringBootPlugin. Can you configure the plugin that's building the RPM package to use this configuration?

Comment From: Vity01

Yes, we can. Thank you.

Comment From: wilkinsona

Excellent. Let's use this issue to mention the configuration in the documentation. It's rather hidden at the moment.

Comment From: Vity01

Just for the others this code snippet example does the job:

                        val cpConfiguration =
                            if (project.configurations.findByName("productionRuntimeClasspath") != null) {
                               // Spring boot plugin classpath without "developmentOnly" deps detected
                                "productionRuntimeClasspath"
                            } else "runtimeClasspath"

                        from(project.configurations.named(cpConfiguration)) {
                            exclude("*-javadoc.jar")                    
                           ...
                        }
                      ...